@lightningjs/blits 0.10.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/boilerplate/js/default/src/index.js +1 -0
  3. package/docs/essentials/displaying_text.md +1 -1
  4. package/package.json +5 -5
  5. package/src/application.js +2 -1
  6. package/src/component/base/events.js +1 -1
  7. package/src/component/base/utils.js +34 -1
  8. package/src/component/setup/props.js +3 -1
  9. package/src/component/setup/props.test.js +51 -19
  10. package/src/component.d.ts +2 -1
  11. package/src/component.js +20 -13
  12. package/src/component.test.js +340 -4
  13. package/src/components/Circle.js +13 -12
  14. package/src/components/FPScounter.js +388 -536
  15. package/src/components/Image.js +7 -9
  16. package/src/components/Layout.js +49 -0
  17. package/src/components/Layout.orig.js +34 -0
  18. package/src/components/RouterView.js +6 -10
  19. package/src/components/Sprite.js +10 -12
  20. package/src/components/index.js +2 -2
  21. package/src/components/index.orig.js +2 -2
  22. package/src/constants.js +14 -0
  23. package/src/engine.js +1 -1
  24. package/src/engines/L3/element.js +193 -180
  25. package/src/engines/L3/element.test.js +170 -0
  26. package/src/engines/L3/fontLoader.js +4 -5
  27. package/src/engines/L3/index.js +2 -2
  28. package/src/engines/L3/launch.js +10 -16
  29. package/src/engines/L3/shaderLoader.js +12 -0
  30. package/src/engines/index.js +1 -1
  31. package/src/focus.js +3 -2
  32. package/src/launch.d.ts +31 -3
  33. package/src/launch.js +1 -1
  34. package/src/lib/codegenerator/generator.js +212 -84
  35. package/src/lib/codegenerator/generator.test.js +657 -942
  36. package/src/lib/colors/colors.js +59 -46
  37. package/src/lib/componentId.js +9 -0
  38. package/src/lib/componentId.test.js +2 -1
  39. package/src/lib/precompiler/precompiler.js +3 -4
  40. package/src/lib/reactivity/effect.js +10 -13
  41. package/src/lib/reactivity/reactive.js +24 -14
  42. package/src/lib/symbols.js +1 -0
  43. package/src/router/router.js +17 -3
  44. package/vite/index.js +1 -4
  45. package/vite/preCompiler.js +3 -1
  46. package/boilerplate/js/default/src/renderer.js +0 -4
  47. package/src/components/Text.js +0 -119
  48. package/src/components/Text.orig.js +0 -81
@@ -23,52 +23,37 @@ export default () =>
23
23
  Component('FPScounter', {
24
24
  /* eslint-disable no-unused-vars */
25
25
  code: {
26
- render: function anonymous(parent, component, context, components) {
26
+ render: function anonymous(parent, component, context, components, effect, getRaw) {
27
27
  const elms = []
28
-
29
- if (!elms[0]) {
30
- elms[0] = this.element({ parent: parent || 'root' }, component)
31
- }
28
+ let componentType
29
+ const rootComponent = component
32
30
  const elementConfig0 = {}
33
31
 
34
- if (!elms[0].nodeId) {
35
- elms[0].populate(elementConfig0)
36
- }
32
+ elms[0] = this.element({ parent: parent || 'root' }, component)
37
33
 
34
+ elms[0].populate(elementConfig0)
38
35
  parent = elms[0]
39
-
40
- if (!elms[1]) {
41
- elms[1] = this.element({ parent: parent || 'root' }, component)
42
- }
43
36
  const elementConfig1 = {}
44
37
 
38
+ elms[1] = this.element({ parent: parent || 'root' }, component)
39
+
45
40
  elementConfig1['y'] = 15
46
41
  elementConfig1['x'] = 20
47
-
48
- if (!elms[1].nodeId) {
49
- elms[1].populate(elementConfig1)
50
- }
51
-
42
+ elms[1].populate(elementConfig1)
52
43
  parent = elms[1]
53
-
54
- if (!elms[2]) {
55
- elms[2] = this.element({ parent: parent || 'root' }, component)
56
- }
57
44
  const elementConfig2 = {}
58
45
 
59
- if (!elms[2].nodeId) {
60
- elms[2].populate(elementConfig2)
61
- }
46
+ elms[2] = this.element({ parent: parent || 'root' }, component)
47
+
48
+ elms[2].populate(elementConfig2)
62
49
 
63
50
  const cmp3 = (context.components && context.components['Sprite']) || components['Sprite']
64
51
 
65
52
  parent = elms[2]
66
-
67
- if (!elms[3]) {
68
- elms[3] = this.element({ parent: parent || 'root' }, component)
69
- }
70
53
  const elementConfig3 = {}
71
54
 
55
+ elms[3] = this.element({ parent: parent || 'root' }, component)
56
+
72
57
  elementConfig3['image'] = component.image
73
58
  elementConfig3['w'] = 43
74
59
  elementConfig3['h'] = 25
@@ -81,10 +66,7 @@ export default () =>
81
66
  }
82
67
  }
83
68
 
84
- if (!elms[3].nodeId) {
85
- elms[3].populate(elementConfig3)
86
- }
87
-
69
+ elms[3].populate(elementConfig3)
88
70
  parent = elms[3]
89
71
  const props4 = {}
90
72
  props4['image'] = component.image
@@ -93,58 +75,50 @@ export default () =>
93
75
  props4['map'] = component.sprite
94
76
  props4['frame'] = 'fps'
95
77
 
96
- if (!elms[4]) {
97
- const componentType = props4['is'] || 'Sprite'
98
-
99
- let component4
100
- if (typeof componentType === 'string') {
101
- component4 =
102
- (context.components && context.components[componentType]) || components[componentType]
103
- if (!component4) {
104
- throw new Error('Component "Sprite" not found')
105
- }
106
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
107
- component4 = componentType
108
- }
109
-
110
- elms[4] = component4.call(null, { props: props4 }, elms[3], component)
78
+ componentType = props4['is'] || 'Sprite'
111
79
 
112
- if (elms[4][Symbol.for('slots')][0]) {
113
- parent = elms[4][Symbol.for('slots')][0]
114
- component = elms[4]
115
- } else {
116
- parent = elms[4][Symbol.for('children')][0]
80
+ let component4
81
+ if (typeof componentType === 'string') {
82
+ component4 =
83
+ (context.components && context.components[componentType]) || components[componentType]
84
+ if (!component4) {
85
+ throw new Error('Component "Sprite" not found')
117
86
  }
87
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
88
+ component4 = componentType
118
89
  }
119
90
 
120
- parent = elms[2]
91
+ elms[4] = component4.call(null, { props: props4 }, elms[3], component)
121
92
 
122
- if (!elms[5]) {
123
- elms[5] = this.element({ parent: parent || 'root' }, component)
93
+ if (elms[4][Symbol.for('slots')][0]) {
94
+ parent = elms[4][Symbol.for('slots')][0]
95
+ component = elms[4]
96
+ } else {
97
+ parent = elms[4][Symbol.for('children')][0]
124
98
  }
99
+
100
+ parent = elms[2]
125
101
  const elementConfig5 = {}
126
102
 
103
+ elms[5] = this.element({ parent: parent || 'root' }, component)
104
+
127
105
  elementConfig5['x'] = 58
128
106
  elementConfig5['y'] = 2
129
-
130
- if (!elms[5].nodeId) {
131
- elms[5].populate(elementConfig5)
132
- }
107
+ elms[5].populate(elementConfig5)
133
108
 
134
109
  const cmp6 = (context.components && context.components['Sprite']) || components['Sprite']
135
110
 
136
111
  parent = elms[5]
137
-
138
- if (!elms[6]) {
139
- elms[6] = this.element({ parent: parent || 'root' }, component)
140
- }
141
112
  const elementConfig6 = {}
142
113
 
114
+ elms[6] = this.element({ parent: parent || 'root' }, component)
115
+
143
116
  elementConfig6['image'] = component.image
144
117
  elementConfig6['x'] = 0
145
118
  elementConfig6['h'] = 20
146
119
  elementConfig6['w'] = 20
147
120
  elementConfig6['map'] = component.sprite
121
+ elementConfig6['frame'] = component.fps[0]
148
122
 
149
123
  if (typeof cmp6 !== 'undefined') {
150
124
  for (let key in cmp6.config.props) {
@@ -152,10 +126,7 @@ export default () =>
152
126
  }
153
127
  }
154
128
 
155
- if (!elms[6].nodeId) {
156
- elms[6].populate(elementConfig6)
157
- }
158
-
129
+ elms[6].populate(elementConfig6)
159
130
  parent = elms[6]
160
131
  const props7 = {}
161
132
  props7['image'] = component.image
@@ -165,44 +136,41 @@ export default () =>
165
136
  props7['map'] = component.sprite
166
137
  props7['frame'] = component.fps[0]
167
138
 
168
- if (!elms[7]) {
169
- const componentType = props7['is'] || 'Sprite'
170
-
171
- let component7
172
- if (typeof componentType === 'string') {
173
- component7 =
174
- (context.components && context.components[componentType]) || components[componentType]
175
- if (!component7) {
176
- throw new Error('Component "Sprite" not found')
177
- }
178
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
179
- component7 = componentType
139
+ componentType = props7['is'] || 'Sprite'
140
+
141
+ let component7
142
+ if (typeof componentType === 'string') {
143
+ component7 =
144
+ (context.components && context.components[componentType]) || components[componentType]
145
+ if (!component7) {
146
+ throw new Error('Component "Sprite" not found')
180
147
  }
148
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
149
+ component7 = componentType
150
+ }
181
151
 
182
- elms[7] = component7.call(null, { props: props7 }, elms[6], component)
152
+ elms[7] = component7.call(null, { props: props7 }, elms[6], component)
183
153
 
184
- if (elms[7][Symbol.for('slots')][0]) {
185
- parent = elms[7][Symbol.for('slots')][0]
186
- component = elms[7]
187
- } else {
188
- parent = elms[7][Symbol.for('children')][0]
189
- }
154
+ if (elms[7][Symbol.for('slots')][0]) {
155
+ parent = elms[7][Symbol.for('slots')][0]
156
+ component = elms[7]
157
+ } else {
158
+ parent = elms[7][Symbol.for('children')][0]
190
159
  }
191
160
 
192
161
  const cmp8 = (context.components && context.components['Sprite']) || components['Sprite']
193
162
 
194
163
  parent = elms[5]
195
-
196
- if (!elms[8]) {
197
- elms[8] = this.element({ parent: parent || 'root' }, component)
198
- }
199
164
  const elementConfig8 = {}
200
165
 
166
+ elms[8] = this.element({ parent: parent || 'root' }, component)
167
+
201
168
  elementConfig8['image'] = component.image
202
169
  elementConfig8['x'] = 18
203
170
  elementConfig8['h'] = 20
204
171
  elementConfig8['w'] = 20
205
172
  elementConfig8['map'] = component.sprite
173
+ elementConfig8['frame'] = component.fps[1]
206
174
 
207
175
  if (typeof cmp8 !== 'undefined') {
208
176
  for (let key in cmp8.config.props) {
@@ -210,10 +178,7 @@ export default () =>
210
178
  }
211
179
  }
212
180
 
213
- if (!elms[8].nodeId) {
214
- elms[8].populate(elementConfig8)
215
- }
216
-
181
+ elms[8].populate(elementConfig8)
217
182
  parent = elms[8]
218
183
  const props9 = {}
219
184
  props9['image'] = component.image
@@ -223,44 +188,41 @@ export default () =>
223
188
  props9['map'] = component.sprite
224
189
  props9['frame'] = component.fps[1]
225
190
 
226
- if (!elms[9]) {
227
- const componentType = props9['is'] || 'Sprite'
228
-
229
- let component9
230
- if (typeof componentType === 'string') {
231
- component9 =
232
- (context.components && context.components[componentType]) || components[componentType]
233
- if (!component9) {
234
- throw new Error('Component "Sprite" not found')
235
- }
236
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
237
- component9 = componentType
191
+ componentType = props9['is'] || 'Sprite'
192
+
193
+ let component9
194
+ if (typeof componentType === 'string') {
195
+ component9 =
196
+ (context.components && context.components[componentType]) || components[componentType]
197
+ if (!component9) {
198
+ throw new Error('Component "Sprite" not found')
238
199
  }
200
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
201
+ component9 = componentType
202
+ }
239
203
 
240
- elms[9] = component9.call(null, { props: props9 }, elms[8], component)
204
+ elms[9] = component9.call(null, { props: props9 }, elms[8], component)
241
205
 
242
- if (elms[9][Symbol.for('slots')][0]) {
243
- parent = elms[9][Symbol.for('slots')][0]
244
- component = elms[9]
245
- } else {
246
- parent = elms[9][Symbol.for('children')][0]
247
- }
206
+ if (elms[9][Symbol.for('slots')][0]) {
207
+ parent = elms[9][Symbol.for('slots')][0]
208
+ component = elms[9]
209
+ } else {
210
+ parent = elms[9][Symbol.for('children')][0]
248
211
  }
249
212
 
250
213
  const cmp10 = (context.components && context.components['Sprite']) || components['Sprite']
251
214
 
252
215
  parent = elms[5]
253
-
254
- if (!elms[10]) {
255
- elms[10] = this.element({ parent: parent || 'root' }, component)
256
- }
257
216
  const elementConfig10 = {}
258
217
 
218
+ elms[10] = this.element({ parent: parent || 'root' }, component)
219
+
259
220
  elementConfig10['image'] = component.image
260
221
  elementConfig10['x'] = 36
261
222
  elementConfig10['h'] = 20
262
223
  elementConfig10['w'] = 20
263
224
  elementConfig10['map'] = component.sprite
225
+ elementConfig10['frame'] = component.fps[2]
264
226
 
265
227
  if (typeof cmp10 !== 'undefined') {
266
228
  for (let key in cmp10.config.props) {
@@ -268,10 +230,7 @@ export default () =>
268
230
  }
269
231
  }
270
232
 
271
- if (!elms[10].nodeId) {
272
- elms[10].populate(elementConfig10)
273
- }
274
-
233
+ elms[10].populate(elementConfig10)
275
234
  parent = elms[10]
276
235
  const props11 = {}
277
236
  props11['image'] = component.image
@@ -281,52 +240,43 @@ export default () =>
281
240
  props11['map'] = component.sprite
282
241
  props11['frame'] = component.fps[2]
283
242
 
284
- if (!elms[11]) {
285
- const componentType = props11['is'] || 'Sprite'
286
-
287
- let component11
288
- if (typeof componentType === 'string') {
289
- component11 =
290
- (context.components && context.components[componentType]) || components[componentType]
291
- if (!component11) {
292
- throw new Error('Component "Sprite" not found')
293
- }
294
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
295
- component11 = componentType
296
- }
297
-
298
- elms[11] = component11.call(null, { props: props11 }, elms[10], component)
243
+ componentType = props11['is'] || 'Sprite'
299
244
 
300
- if (elms[11][Symbol.for('slots')][0]) {
301
- parent = elms[11][Symbol.for('slots')][0]
302
- component = elms[11]
303
- } else {
304
- parent = elms[11][Symbol.for('children')][0]
245
+ let component11
246
+ if (typeof componentType === 'string') {
247
+ component11 =
248
+ (context.components && context.components[componentType]) || components[componentType]
249
+ if (!component11) {
250
+ throw new Error('Component "Sprite" not found')
305
251
  }
252
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
253
+ component11 = componentType
306
254
  }
307
255
 
308
- parent = elms[1]
256
+ elms[11] = component11.call(null, { props: props11 }, elms[10], component)
309
257
 
310
- if (!elms[12]) {
311
- elms[12] = this.element({ parent: parent || 'root' }, component)
258
+ if (elms[11][Symbol.for('slots')][0]) {
259
+ parent = elms[11][Symbol.for('slots')][0]
260
+ component = elms[11]
261
+ } else {
262
+ parent = elms[11][Symbol.for('children')][0]
312
263
  }
264
+
265
+ parent = elms[1]
313
266
  const elementConfig12 = {}
314
267
 
315
- elementConfig12['x'] = 150
268
+ elms[12] = this.element({ parent: parent || 'root' }, component)
316
269
 
317
- if (!elms[12].nodeId) {
318
- elms[12].populate(elementConfig12)
319
- }
270
+ elementConfig12['x'] = 150
271
+ elms[12].populate(elementConfig12)
320
272
 
321
273
  const cmp13 = (context.components && context.components['Sprite']) || components['Sprite']
322
274
 
323
275
  parent = elms[12]
324
-
325
- if (!elms[13]) {
326
- elms[13] = this.element({ parent: parent || 'root' }, component)
327
- }
328
276
  const elementConfig13 = {}
329
277
 
278
+ elms[13] = this.element({ parent: parent || 'root' }, component)
279
+
330
280
  elementConfig13['image'] = component.image
331
281
  elementConfig13['y'] = 2
332
282
  elementConfig13['w'] = 48
@@ -340,10 +290,7 @@ export default () =>
340
290
  }
341
291
  }
342
292
 
343
- if (!elms[13].nodeId) {
344
- elms[13].populate(elementConfig13)
345
- }
346
-
293
+ elms[13].populate(elementConfig13)
347
294
  parent = elms[13]
348
295
  const props14 = {}
349
296
  props14['image'] = component.image
@@ -353,58 +300,50 @@ export default () =>
353
300
  props14['map'] = component.sprite
354
301
  props14['frame'] = 'avg'
355
302
 
356
- if (!elms[14]) {
357
- const componentType = props14['is'] || 'Sprite'
358
-
359
- let component14
360
- if (typeof componentType === 'string') {
361
- component14 =
362
- (context.components && context.components[componentType]) || components[componentType]
363
- if (!component14) {
364
- throw new Error('Component "Sprite" not found')
365
- }
366
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
367
- component14 = componentType
368
- }
303
+ componentType = props14['is'] || 'Sprite'
369
304
 
370
- elms[14] = component14.call(null, { props: props14 }, elms[13], component)
371
-
372
- if (elms[14][Symbol.for('slots')][0]) {
373
- parent = elms[14][Symbol.for('slots')][0]
374
- component = elms[14]
375
- } else {
376
- parent = elms[14][Symbol.for('children')][0]
305
+ let component14
306
+ if (typeof componentType === 'string') {
307
+ component14 =
308
+ (context.components && context.components[componentType]) || components[componentType]
309
+ if (!component14) {
310
+ throw new Error('Component "Sprite" not found')
377
311
  }
312
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
313
+ component14 = componentType
378
314
  }
379
315
 
380
- parent = elms[12]
316
+ elms[14] = component14.call(null, { props: props14 }, elms[13], component)
381
317
 
382
- if (!elms[15]) {
383
- elms[15] = this.element({ parent: parent || 'root' }, component)
318
+ if (elms[14][Symbol.for('slots')][0]) {
319
+ parent = elms[14][Symbol.for('slots')][0]
320
+ component = elms[14]
321
+ } else {
322
+ parent = elms[14][Symbol.for('children')][0]
384
323
  }
324
+
325
+ parent = elms[12]
385
326
  const elementConfig15 = {}
386
327
 
328
+ elms[15] = this.element({ parent: parent || 'root' }, component)
329
+
387
330
  elementConfig15['x'] = 63
388
331
  elementConfig15['y'] = 2
389
-
390
- if (!elms[15].nodeId) {
391
- elms[15].populate(elementConfig15)
392
- }
332
+ elms[15].populate(elementConfig15)
393
333
 
394
334
  const cmp16 = (context.components && context.components['Sprite']) || components['Sprite']
395
335
 
396
336
  parent = elms[15]
397
-
398
- if (!elms[16]) {
399
- elms[16] = this.element({ parent: parent || 'root' }, component)
400
- }
401
337
  const elementConfig16 = {}
402
338
 
339
+ elms[16] = this.element({ parent: parent || 'root' }, component)
340
+
403
341
  elementConfig16['image'] = component.image
404
342
  elementConfig16['x'] = 0
405
343
  elementConfig16['h'] = 20
406
344
  elementConfig16['w'] = 20
407
345
  elementConfig16['map'] = component.sprite
346
+ elementConfig16['frame'] = component.avgFps[0]
408
347
 
409
348
  if (typeof cmp16 !== 'undefined') {
410
349
  for (let key in cmp16.config.props) {
@@ -412,10 +351,7 @@ export default () =>
412
351
  }
413
352
  }
414
353
 
415
- if (!elms[16].nodeId) {
416
- elms[16].populate(elementConfig16)
417
- }
418
-
354
+ elms[16].populate(elementConfig16)
419
355
  parent = elms[16]
420
356
  const props17 = {}
421
357
  props17['image'] = component.image
@@ -425,44 +361,41 @@ export default () =>
425
361
  props17['map'] = component.sprite
426
362
  props17['frame'] = component.avgFps[0]
427
363
 
428
- if (!elms[17]) {
429
- const componentType = props17['is'] || 'Sprite'
430
-
431
- let component17
432
- if (typeof componentType === 'string') {
433
- component17 =
434
- (context.components && context.components[componentType]) || components[componentType]
435
- if (!component17) {
436
- throw new Error('Component "Sprite" not found')
437
- }
438
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
439
- component17 = componentType
364
+ componentType = props17['is'] || 'Sprite'
365
+
366
+ let component17
367
+ if (typeof componentType === 'string') {
368
+ component17 =
369
+ (context.components && context.components[componentType]) || components[componentType]
370
+ if (!component17) {
371
+ throw new Error('Component "Sprite" not found')
440
372
  }
373
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
374
+ component17 = componentType
375
+ }
441
376
 
442
- elms[17] = component17.call(null, { props: props17 }, elms[16], component)
377
+ elms[17] = component17.call(null, { props: props17 }, elms[16], component)
443
378
 
444
- if (elms[17][Symbol.for('slots')][0]) {
445
- parent = elms[17][Symbol.for('slots')][0]
446
- component = elms[17]
447
- } else {
448
- parent = elms[17][Symbol.for('children')][0]
449
- }
379
+ if (elms[17][Symbol.for('slots')][0]) {
380
+ parent = elms[17][Symbol.for('slots')][0]
381
+ component = elms[17]
382
+ } else {
383
+ parent = elms[17][Symbol.for('children')][0]
450
384
  }
451
385
 
452
386
  const cmp18 = (context.components && context.components['Sprite']) || components['Sprite']
453
387
 
454
388
  parent = elms[15]
455
-
456
- if (!elms[18]) {
457
- elms[18] = this.element({ parent: parent || 'root' }, component)
458
- }
459
389
  const elementConfig18 = {}
460
390
 
391
+ elms[18] = this.element({ parent: parent || 'root' }, component)
392
+
461
393
  elementConfig18['image'] = component.image
462
394
  elementConfig18['x'] = 18
463
395
  elementConfig18['h'] = 20
464
396
  elementConfig18['w'] = 20
465
397
  elementConfig18['map'] = component.sprite
398
+ elementConfig18['frame'] = component.avgFps[1]
466
399
 
467
400
  if (typeof cmp18 !== 'undefined') {
468
401
  for (let key in cmp18.config.props) {
@@ -470,10 +403,7 @@ export default () =>
470
403
  }
471
404
  }
472
405
 
473
- if (!elms[18].nodeId) {
474
- elms[18].populate(elementConfig18)
475
- }
476
-
406
+ elms[18].populate(elementConfig18)
477
407
  parent = elms[18]
478
408
  const props19 = {}
479
409
  props19['image'] = component.image
@@ -483,44 +413,41 @@ export default () =>
483
413
  props19['map'] = component.sprite
484
414
  props19['frame'] = component.avgFps[1]
485
415
 
486
- if (!elms[19]) {
487
- const componentType = props19['is'] || 'Sprite'
488
-
489
- let component19
490
- if (typeof componentType === 'string') {
491
- component19 =
492
- (context.components && context.components[componentType]) || components[componentType]
493
- if (!component19) {
494
- throw new Error('Component "Sprite" not found')
495
- }
496
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
497
- component19 = componentType
416
+ componentType = props19['is'] || 'Sprite'
417
+
418
+ let component19
419
+ if (typeof componentType === 'string') {
420
+ component19 =
421
+ (context.components && context.components[componentType]) || components[componentType]
422
+ if (!component19) {
423
+ throw new Error('Component "Sprite" not found')
498
424
  }
425
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
426
+ component19 = componentType
427
+ }
499
428
 
500
- elms[19] = component19.call(null, { props: props19 }, elms[18], component)
429
+ elms[19] = component19.call(null, { props: props19 }, elms[18], component)
501
430
 
502
- if (elms[19][Symbol.for('slots')][0]) {
503
- parent = elms[19][Symbol.for('slots')][0]
504
- component = elms[19]
505
- } else {
506
- parent = elms[19][Symbol.for('children')][0]
507
- }
431
+ if (elms[19][Symbol.for('slots')][0]) {
432
+ parent = elms[19][Symbol.for('slots')][0]
433
+ component = elms[19]
434
+ } else {
435
+ parent = elms[19][Symbol.for('children')][0]
508
436
  }
509
437
 
510
438
  const cmp20 = (context.components && context.components['Sprite']) || components['Sprite']
511
439
 
512
440
  parent = elms[15]
513
-
514
- if (!elms[20]) {
515
- elms[20] = this.element({ parent: parent || 'root' }, component)
516
- }
517
441
  const elementConfig20 = {}
518
442
 
443
+ elms[20] = this.element({ parent: parent || 'root' }, component)
444
+
519
445
  elementConfig20['image'] = component.image
520
446
  elementConfig20['x'] = 36
521
447
  elementConfig20['h'] = 20
522
448
  elementConfig20['w'] = 20
523
449
  elementConfig20['map'] = component.sprite
450
+ elementConfig20['frame'] = component.avgFps[2]
524
451
 
525
452
  if (typeof cmp20 !== 'undefined') {
526
453
  for (let key in cmp20.config.props) {
@@ -528,10 +455,7 @@ export default () =>
528
455
  }
529
456
  }
530
457
 
531
- if (!elms[20].nodeId) {
532
- elms[20].populate(elementConfig20)
533
- }
534
-
458
+ elms[20].populate(elementConfig20)
535
459
  parent = elms[20]
536
460
  const props21 = {}
537
461
  props21['image'] = component.image
@@ -541,53 +465,44 @@ export default () =>
541
465
  props21['map'] = component.sprite
542
466
  props21['frame'] = component.avgFps[2]
543
467
 
544
- if (!elms[21]) {
545
- const componentType = props21['is'] || 'Sprite'
546
-
547
- let component21
548
- if (typeof componentType === 'string') {
549
- component21 =
550
- (context.components && context.components[componentType]) || components[componentType]
551
- if (!component21) {
552
- throw new Error('Component "Sprite" not found')
553
- }
554
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
555
- component21 = componentType
556
- }
557
-
558
- elms[21] = component21.call(null, { props: props21 }, elms[20], component)
468
+ componentType = props21['is'] || 'Sprite'
559
469
 
560
- if (elms[21][Symbol.for('slots')][0]) {
561
- parent = elms[21][Symbol.for('slots')][0]
562
- component = elms[21]
563
- } else {
564
- parent = elms[21][Symbol.for('children')][0]
470
+ let component21
471
+ if (typeof componentType === 'string') {
472
+ component21 =
473
+ (context.components && context.components[componentType]) || components[componentType]
474
+ if (!component21) {
475
+ throw new Error('Component "Sprite" not found')
565
476
  }
477
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
478
+ component21 = componentType
566
479
  }
567
480
 
568
- parent = elms[1]
481
+ elms[21] = component21.call(null, { props: props21 }, elms[20], component)
569
482
 
570
- if (!elms[22]) {
571
- elms[22] = this.element({ parent: parent || 'root' }, component)
483
+ if (elms[21][Symbol.for('slots')][0]) {
484
+ parent = elms[21][Symbol.for('slots')][0]
485
+ component = elms[21]
486
+ } else {
487
+ parent = elms[21][Symbol.for('children')][0]
572
488
  }
489
+
490
+ parent = elms[1]
573
491
  const elementConfig22 = {}
574
492
 
493
+ elms[22] = this.element({ parent: parent || 'root' }, component)
494
+
575
495
  elementConfig22['x'] = 0
576
496
  elementConfig22['y'] = 40
577
-
578
- if (!elms[22].nodeId) {
579
- elms[22].populate(elementConfig22)
580
- }
497
+ elms[22].populate(elementConfig22)
581
498
 
582
499
  const cmp23 = (context.components && context.components['Sprite']) || components['Sprite']
583
500
 
584
501
  parent = elms[22]
585
-
586
- if (!elms[23]) {
587
- elms[23] = this.element({ parent: parent || 'root' }, component)
588
- }
589
502
  const elementConfig23 = {}
590
503
 
504
+ elms[23] = this.element({ parent: parent || 'root' }, component)
505
+
591
506
  elementConfig23['image'] = component.image
592
507
  elementConfig23['x'] = -2
593
508
  elementConfig23['w'] = 47
@@ -601,10 +516,7 @@ export default () =>
601
516
  }
602
517
  }
603
518
 
604
- if (!elms[23].nodeId) {
605
- elms[23].populate(elementConfig23)
606
- }
607
-
519
+ elms[23].populate(elementConfig23)
608
520
  parent = elms[23]
609
521
  const props24 = {}
610
522
  props24['image'] = component.image
@@ -614,58 +526,50 @@ export default () =>
614
526
  props24['map'] = component.sprite
615
527
  props24['frame'] = 'min'
616
528
 
617
- if (!elms[24]) {
618
- const componentType = props24['is'] || 'Sprite'
619
-
620
- let component24
621
- if (typeof componentType === 'string') {
622
- component24 =
623
- (context.components && context.components[componentType]) || components[componentType]
624
- if (!component24) {
625
- throw new Error('Component "Sprite" not found')
626
- }
627
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
628
- component24 = componentType
629
- }
630
-
631
- elms[24] = component24.call(null, { props: props24 }, elms[23], component)
529
+ componentType = props24['is'] || 'Sprite'
632
530
 
633
- if (elms[24][Symbol.for('slots')][0]) {
634
- parent = elms[24][Symbol.for('slots')][0]
635
- component = elms[24]
636
- } else {
637
- parent = elms[24][Symbol.for('children')][0]
531
+ let component24
532
+ if (typeof componentType === 'string') {
533
+ component24 =
534
+ (context.components && context.components[componentType]) || components[componentType]
535
+ if (!component24) {
536
+ throw new Error('Component "Sprite" not found')
638
537
  }
538
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
539
+ component24 = componentType
639
540
  }
640
541
 
641
- parent = elms[22]
542
+ elms[24] = component24.call(null, { props: props24 }, elms[23], component)
642
543
 
643
- if (!elms[25]) {
644
- elms[25] = this.element({ parent: parent || 'root' }, component)
544
+ if (elms[24][Symbol.for('slots')][0]) {
545
+ parent = elms[24][Symbol.for('slots')][0]
546
+ component = elms[24]
547
+ } else {
548
+ parent = elms[24][Symbol.for('children')][0]
645
549
  }
550
+
551
+ parent = elms[22]
646
552
  const elementConfig25 = {}
647
553
 
554
+ elms[25] = this.element({ parent: parent || 'root' }, component)
555
+
648
556
  elementConfig25['x'] = 58
649
557
  elementConfig25['y'] = 2
650
-
651
- if (!elms[25].nodeId) {
652
- elms[25].populate(elementConfig25)
653
- }
558
+ elms[25].populate(elementConfig25)
654
559
 
655
560
  const cmp26 = (context.components && context.components['Sprite']) || components['Sprite']
656
561
 
657
562
  parent = elms[25]
658
-
659
- if (!elms[26]) {
660
- elms[26] = this.element({ parent: parent || 'root' }, component)
661
- }
662
563
  const elementConfig26 = {}
663
564
 
565
+ elms[26] = this.element({ parent: parent || 'root' }, component)
566
+
664
567
  elementConfig26['image'] = component.image
665
568
  elementConfig26['x'] = 0
666
569
  elementConfig26['h'] = 20
667
570
  elementConfig26['w'] = 20
668
571
  elementConfig26['map'] = component.sprite
572
+ elementConfig26['frame'] = component.minFps[0]
669
573
 
670
574
  if (typeof cmp26 !== 'undefined') {
671
575
  for (let key in cmp26.config.props) {
@@ -673,10 +577,7 @@ export default () =>
673
577
  }
674
578
  }
675
579
 
676
- if (!elms[26].nodeId) {
677
- elms[26].populate(elementConfig26)
678
- }
679
-
580
+ elms[26].populate(elementConfig26)
680
581
  parent = elms[26]
681
582
  const props27 = {}
682
583
  props27['image'] = component.image
@@ -686,44 +587,41 @@ export default () =>
686
587
  props27['map'] = component.sprite
687
588
  props27['frame'] = component.minFps[0]
688
589
 
689
- if (!elms[27]) {
690
- const componentType = props27['is'] || 'Sprite'
691
-
692
- let component27
693
- if (typeof componentType === 'string') {
694
- component27 =
695
- (context.components && context.components[componentType]) || components[componentType]
696
- if (!component27) {
697
- throw new Error('Component "Sprite" not found')
698
- }
699
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
700
- component27 = componentType
590
+ componentType = props27['is'] || 'Sprite'
591
+
592
+ let component27
593
+ if (typeof componentType === 'string') {
594
+ component27 =
595
+ (context.components && context.components[componentType]) || components[componentType]
596
+ if (!component27) {
597
+ throw new Error('Component "Sprite" not found')
701
598
  }
599
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
600
+ component27 = componentType
601
+ }
702
602
 
703
- elms[27] = component27.call(null, { props: props27 }, elms[26], component)
603
+ elms[27] = component27.call(null, { props: props27 }, elms[26], component)
704
604
 
705
- if (elms[27][Symbol.for('slots')][0]) {
706
- parent = elms[27][Symbol.for('slots')][0]
707
- component = elms[27]
708
- } else {
709
- parent = elms[27][Symbol.for('children')][0]
710
- }
605
+ if (elms[27][Symbol.for('slots')][0]) {
606
+ parent = elms[27][Symbol.for('slots')][0]
607
+ component = elms[27]
608
+ } else {
609
+ parent = elms[27][Symbol.for('children')][0]
711
610
  }
712
611
 
713
612
  const cmp28 = (context.components && context.components['Sprite']) || components['Sprite']
714
613
 
715
614
  parent = elms[25]
716
-
717
- if (!elms[28]) {
718
- elms[28] = this.element({ parent: parent || 'root' }, component)
719
- }
720
615
  const elementConfig28 = {}
721
616
 
617
+ elms[28] = this.element({ parent: parent || 'root' }, component)
618
+
722
619
  elementConfig28['image'] = component.image
723
620
  elementConfig28['x'] = 18
724
621
  elementConfig28['h'] = 20
725
622
  elementConfig28['w'] = 20
726
623
  elementConfig28['map'] = component.sprite
624
+ elementConfig28['frame'] = component.minFps[1]
727
625
 
728
626
  if (typeof cmp28 !== 'undefined') {
729
627
  for (let key in cmp28.config.props) {
@@ -731,10 +629,7 @@ export default () =>
731
629
  }
732
630
  }
733
631
 
734
- if (!elms[28].nodeId) {
735
- elms[28].populate(elementConfig28)
736
- }
737
-
632
+ elms[28].populate(elementConfig28)
738
633
  parent = elms[28]
739
634
  const props29 = {}
740
635
  props29['image'] = component.image
@@ -744,44 +639,41 @@ export default () =>
744
639
  props29['map'] = component.sprite
745
640
  props29['frame'] = component.minFps[1]
746
641
 
747
- if (!elms[29]) {
748
- const componentType = props29['is'] || 'Sprite'
749
-
750
- let component29
751
- if (typeof componentType === 'string') {
752
- component29 =
753
- (context.components && context.components[componentType]) || components[componentType]
754
- if (!component29) {
755
- throw new Error('Component "Sprite" not found')
756
- }
757
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
758
- component29 = componentType
642
+ componentType = props29['is'] || 'Sprite'
643
+
644
+ let component29
645
+ if (typeof componentType === 'string') {
646
+ component29 =
647
+ (context.components && context.components[componentType]) || components[componentType]
648
+ if (!component29) {
649
+ throw new Error('Component "Sprite" not found')
759
650
  }
651
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
652
+ component29 = componentType
653
+ }
760
654
 
761
- elms[29] = component29.call(null, { props: props29 }, elms[28], component)
655
+ elms[29] = component29.call(null, { props: props29 }, elms[28], component)
762
656
 
763
- if (elms[29][Symbol.for('slots')][0]) {
764
- parent = elms[29][Symbol.for('slots')][0]
765
- component = elms[29]
766
- } else {
767
- parent = elms[29][Symbol.for('children')][0]
768
- }
657
+ if (elms[29][Symbol.for('slots')][0]) {
658
+ parent = elms[29][Symbol.for('slots')][0]
659
+ component = elms[29]
660
+ } else {
661
+ parent = elms[29][Symbol.for('children')][0]
769
662
  }
770
663
 
771
664
  const cmp30 = (context.components && context.components['Sprite']) || components['Sprite']
772
665
 
773
666
  parent = elms[25]
774
-
775
- if (!elms[30]) {
776
- elms[30] = this.element({ parent: parent || 'root' }, component)
777
- }
778
667
  const elementConfig30 = {}
779
668
 
669
+ elms[30] = this.element({ parent: parent || 'root' }, component)
670
+
780
671
  elementConfig30['image'] = component.image
781
672
  elementConfig30['x'] = 36
782
673
  elementConfig30['h'] = 20
783
674
  elementConfig30['w'] = 20
784
675
  elementConfig30['map'] = component.sprite
676
+ elementConfig30['frame'] = component.minFps[2]
785
677
 
786
678
  if (typeof cmp30 !== 'undefined') {
787
679
  for (let key in cmp30.config.props) {
@@ -789,10 +681,7 @@ export default () =>
789
681
  }
790
682
  }
791
683
 
792
- if (!elms[30].nodeId) {
793
- elms[30].populate(elementConfig30)
794
- }
795
-
684
+ elms[30].populate(elementConfig30)
796
685
  parent = elms[30]
797
686
  const props31 = {}
798
687
  props31['image'] = component.image
@@ -802,53 +691,44 @@ export default () =>
802
691
  props31['map'] = component.sprite
803
692
  props31['frame'] = component.minFps[2]
804
693
 
805
- if (!elms[31]) {
806
- const componentType = props31['is'] || 'Sprite'
807
-
808
- let component31
809
- if (typeof componentType === 'string') {
810
- component31 =
811
- (context.components && context.components[componentType]) || components[componentType]
812
- if (!component31) {
813
- throw new Error('Component "Sprite" not found')
814
- }
815
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
816
- component31 = componentType
817
- }
818
-
819
- elms[31] = component31.call(null, { props: props31 }, elms[30], component)
694
+ componentType = props31['is'] || 'Sprite'
820
695
 
821
- if (elms[31][Symbol.for('slots')][0]) {
822
- parent = elms[31][Symbol.for('slots')][0]
823
- component = elms[31]
824
- } else {
825
- parent = elms[31][Symbol.for('children')][0]
696
+ let component31
697
+ if (typeof componentType === 'string') {
698
+ component31 =
699
+ (context.components && context.components[componentType]) || components[componentType]
700
+ if (!component31) {
701
+ throw new Error('Component "Sprite" not found')
826
702
  }
703
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
704
+ component31 = componentType
827
705
  }
828
706
 
829
- parent = elms[1]
707
+ elms[31] = component31.call(null, { props: props31 }, elms[30], component)
830
708
 
831
- if (!elms[32]) {
832
- elms[32] = this.element({ parent: parent || 'root' }, component)
709
+ if (elms[31][Symbol.for('slots')][0]) {
710
+ parent = elms[31][Symbol.for('slots')][0]
711
+ component = elms[31]
712
+ } else {
713
+ parent = elms[31][Symbol.for('children')][0]
833
714
  }
715
+
716
+ parent = elms[1]
834
717
  const elementConfig32 = {}
835
718
 
719
+ elms[32] = this.element({ parent: parent || 'root' }, component)
720
+
836
721
  elementConfig32['x'] = 150
837
722
  elementConfig32['y'] = 40
838
-
839
- if (!elms[32].nodeId) {
840
- elms[32].populate(elementConfig32)
841
- }
723
+ elms[32].populate(elementConfig32)
842
724
 
843
725
  const cmp33 = (context.components && context.components['Sprite']) || components['Sprite']
844
726
 
845
727
  parent = elms[32]
846
-
847
- if (!elms[33]) {
848
- elms[33] = this.element({ parent: parent || 'root' }, component)
849
- }
850
728
  const elementConfig33 = {}
851
729
 
730
+ elms[33] = this.element({ parent: parent || 'root' }, component)
731
+
852
732
  elementConfig33['image'] = component.image
853
733
  elementConfig33['w'] = 53
854
734
  elementConfig33['h'] = 25
@@ -861,10 +741,7 @@ export default () =>
861
741
  }
862
742
  }
863
743
 
864
- if (!elms[33].nodeId) {
865
- elms[33].populate(elementConfig33)
866
- }
867
-
744
+ elms[33].populate(elementConfig33)
868
745
  parent = elms[33]
869
746
  const props34 = {}
870
747
  props34['image'] = component.image
@@ -873,58 +750,50 @@ export default () =>
873
750
  props34['map'] = component.sprite
874
751
  props34['frame'] = 'max'
875
752
 
876
- if (!elms[34]) {
877
- const componentType = props34['is'] || 'Sprite'
878
-
879
- let component34
880
- if (typeof componentType === 'string') {
881
- component34 =
882
- (context.components && context.components[componentType]) || components[componentType]
883
- if (!component34) {
884
- throw new Error('Component "Sprite" not found')
885
- }
886
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
887
- component34 = componentType
888
- }
889
-
890
- elms[34] = component34.call(null, { props: props34 }, elms[33], component)
753
+ componentType = props34['is'] || 'Sprite'
891
754
 
892
- if (elms[34][Symbol.for('slots')][0]) {
893
- parent = elms[34][Symbol.for('slots')][0]
894
- component = elms[34]
895
- } else {
896
- parent = elms[34][Symbol.for('children')][0]
755
+ let component34
756
+ if (typeof componentType === 'string') {
757
+ component34 =
758
+ (context.components && context.components[componentType]) || components[componentType]
759
+ if (!component34) {
760
+ throw new Error('Component "Sprite" not found')
897
761
  }
762
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
763
+ component34 = componentType
898
764
  }
899
765
 
900
- parent = elms[32]
766
+ elms[34] = component34.call(null, { props: props34 }, elms[33], component)
901
767
 
902
- if (!elms[35]) {
903
- elms[35] = this.element({ parent: parent || 'root' }, component)
768
+ if (elms[34][Symbol.for('slots')][0]) {
769
+ parent = elms[34][Symbol.for('slots')][0]
770
+ component = elms[34]
771
+ } else {
772
+ parent = elms[34][Symbol.for('children')][0]
904
773
  }
774
+
775
+ parent = elms[32]
905
776
  const elementConfig35 = {}
906
777
 
778
+ elms[35] = this.element({ parent: parent || 'root' }, component)
779
+
907
780
  elementConfig35['x'] = 63
908
781
  elementConfig35['y'] = 2
909
-
910
- if (!elms[35].nodeId) {
911
- elms[35].populate(elementConfig35)
912
- }
782
+ elms[35].populate(elementConfig35)
913
783
 
914
784
  const cmp36 = (context.components && context.components['Sprite']) || components['Sprite']
915
785
 
916
786
  parent = elms[35]
917
-
918
- if (!elms[36]) {
919
- elms[36] = this.element({ parent: parent || 'root' }, component)
920
- }
921
787
  const elementConfig36 = {}
922
788
 
789
+ elms[36] = this.element({ parent: parent || 'root' }, component)
790
+
923
791
  elementConfig36['image'] = component.image
924
792
  elementConfig36['x'] = 0
925
793
  elementConfig36['h'] = 20
926
794
  elementConfig36['w'] = 20
927
795
  elementConfig36['map'] = component.sprite
796
+ elementConfig36['frame'] = component.maxFps[0]
928
797
 
929
798
  if (typeof cmp36 !== 'undefined') {
930
799
  for (let key in cmp36.config.props) {
@@ -932,10 +801,7 @@ export default () =>
932
801
  }
933
802
  }
934
803
 
935
- if (!elms[36].nodeId) {
936
- elms[36].populate(elementConfig36)
937
- }
938
-
804
+ elms[36].populate(elementConfig36)
939
805
  parent = elms[36]
940
806
  const props37 = {}
941
807
  props37['image'] = component.image
@@ -945,44 +811,41 @@ export default () =>
945
811
  props37['map'] = component.sprite
946
812
  props37['frame'] = component.maxFps[0]
947
813
 
948
- if (!elms[37]) {
949
- const componentType = props37['is'] || 'Sprite'
950
-
951
- let component37
952
- if (typeof componentType === 'string') {
953
- component37 =
954
- (context.components && context.components[componentType]) || components[componentType]
955
- if (!component37) {
956
- throw new Error('Component "Sprite" not found')
957
- }
958
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
959
- component37 = componentType
814
+ componentType = props37['is'] || 'Sprite'
815
+
816
+ let component37
817
+ if (typeof componentType === 'string') {
818
+ component37 =
819
+ (context.components && context.components[componentType]) || components[componentType]
820
+ if (!component37) {
821
+ throw new Error('Component "Sprite" not found')
960
822
  }
823
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
824
+ component37 = componentType
825
+ }
961
826
 
962
- elms[37] = component37.call(null, { props: props37 }, elms[36], component)
827
+ elms[37] = component37.call(null, { props: props37 }, elms[36], component)
963
828
 
964
- if (elms[37][Symbol.for('slots')][0]) {
965
- parent = elms[37][Symbol.for('slots')][0]
966
- component = elms[37]
967
- } else {
968
- parent = elms[37][Symbol.for('children')][0]
969
- }
829
+ if (elms[37][Symbol.for('slots')][0]) {
830
+ parent = elms[37][Symbol.for('slots')][0]
831
+ component = elms[37]
832
+ } else {
833
+ parent = elms[37][Symbol.for('children')][0]
970
834
  }
971
835
 
972
836
  const cmp38 = (context.components && context.components['Sprite']) || components['Sprite']
973
837
 
974
838
  parent = elms[35]
975
-
976
- if (!elms[38]) {
977
- elms[38] = this.element({ parent: parent || 'root' }, component)
978
- }
979
839
  const elementConfig38 = {}
980
840
 
841
+ elms[38] = this.element({ parent: parent || 'root' }, component)
842
+
981
843
  elementConfig38['image'] = component.image
982
844
  elementConfig38['x'] = 18
983
845
  elementConfig38['h'] = 20
984
846
  elementConfig38['w'] = 20
985
847
  elementConfig38['map'] = component.sprite
848
+ elementConfig38['frame'] = component.maxFps[1]
986
849
 
987
850
  if (typeof cmp38 !== 'undefined') {
988
851
  for (let key in cmp38.config.props) {
@@ -990,10 +853,7 @@ export default () =>
990
853
  }
991
854
  }
992
855
 
993
- if (!elms[38].nodeId) {
994
- elms[38].populate(elementConfig38)
995
- }
996
-
856
+ elms[38].populate(elementConfig38)
997
857
  parent = elms[38]
998
858
  const props39 = {}
999
859
  props39['image'] = component.image
@@ -1003,44 +863,41 @@ export default () =>
1003
863
  props39['map'] = component.sprite
1004
864
  props39['frame'] = component.maxFps[1]
1005
865
 
1006
- if (!elms[39]) {
1007
- const componentType = props39['is'] || 'Sprite'
1008
-
1009
- let component39
1010
- if (typeof componentType === 'string') {
1011
- component39 =
1012
- (context.components && context.components[componentType]) || components[componentType]
1013
- if (!component39) {
1014
- throw new Error('Component "Sprite" not found')
1015
- }
1016
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
1017
- component39 = componentType
866
+ componentType = props39['is'] || 'Sprite'
867
+
868
+ let component39
869
+ if (typeof componentType === 'string') {
870
+ component39 =
871
+ (context.components && context.components[componentType]) || components[componentType]
872
+ if (!component39) {
873
+ throw new Error('Component "Sprite" not found')
1018
874
  }
875
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
876
+ component39 = componentType
877
+ }
1019
878
 
1020
- elms[39] = component39.call(null, { props: props39 }, elms[38], component)
879
+ elms[39] = component39.call(null, { props: props39 }, elms[38], component)
1021
880
 
1022
- if (elms[39][Symbol.for('slots')][0]) {
1023
- parent = elms[39][Symbol.for('slots')][0]
1024
- component = elms[39]
1025
- } else {
1026
- parent = elms[39][Symbol.for('children')][0]
1027
- }
881
+ if (elms[39][Symbol.for('slots')][0]) {
882
+ parent = elms[39][Symbol.for('slots')][0]
883
+ component = elms[39]
884
+ } else {
885
+ parent = elms[39][Symbol.for('children')][0]
1028
886
  }
1029
887
 
1030
888
  const cmp40 = (context.components && context.components['Sprite']) || components['Sprite']
1031
889
 
1032
890
  parent = elms[35]
1033
-
1034
- if (!elms[40]) {
1035
- elms[40] = this.element({ parent: parent || 'root' }, component)
1036
- }
1037
891
  const elementConfig40 = {}
1038
892
 
893
+ elms[40] = this.element({ parent: parent || 'root' }, component)
894
+
1039
895
  elementConfig40['image'] = component.image
1040
896
  elementConfig40['x'] = 36
1041
897
  elementConfig40['h'] = 20
1042
898
  elementConfig40['w'] = 20
1043
899
  elementConfig40['map'] = component.sprite
900
+ elementConfig40['frame'] = component.maxFps[2]
1044
901
 
1045
902
  if (typeof cmp40 !== 'undefined') {
1046
903
  for (let key in cmp40.config.props) {
@@ -1048,10 +905,7 @@ export default () =>
1048
905
  }
1049
906
  }
1050
907
 
1051
- if (!elms[40].nodeId) {
1052
- elms[40].populate(elementConfig40)
1053
- }
1054
-
908
+ elms[40].populate(elementConfig40)
1055
909
  parent = elms[40]
1056
910
  const props41 = {}
1057
911
  props41['image'] = component.image
@@ -1061,103 +915,101 @@ export default () =>
1061
915
  props41['map'] = component.sprite
1062
916
  props41['frame'] = component.maxFps[2]
1063
917
 
1064
- if (!elms[41]) {
1065
- const componentType = props41['is'] || 'Sprite'
1066
-
1067
- let component41
1068
- if (typeof componentType === 'string') {
1069
- component41 =
1070
- (context.components && context.components[componentType]) || components[componentType]
1071
- if (!component41) {
1072
- throw new Error('Component "Sprite" not found')
1073
- }
1074
- } else if (typeof componentType === 'function' && componentType.name === 'factory') {
1075
- component41 = componentType
918
+ componentType = props41['is'] || 'Sprite'
919
+
920
+ let component41
921
+ if (typeof componentType === 'string') {
922
+ component41 =
923
+ (context.components && context.components[componentType]) || components[componentType]
924
+ if (!component41) {
925
+ throw new Error('Component "Sprite" not found')
1076
926
  }
927
+ } else if (typeof componentType === 'function' && componentType.name === 'factory') {
928
+ component41 = componentType
929
+ }
1077
930
 
1078
- elms[41] = component41.call(null, { props: props41 }, elms[40], component)
931
+ elms[41] = component41.call(null, { props: props41 }, elms[40], component)
1079
932
 
1080
- if (elms[41][Symbol.for('slots')][0]) {
1081
- parent = elms[41][Symbol.for('slots')][0]
1082
- component = elms[41]
1083
- } else {
1084
- parent = elms[41][Symbol.for('children')][0]
1085
- }
933
+ if (elms[41][Symbol.for('slots')][0]) {
934
+ parent = elms[41][Symbol.for('slots')][0]
935
+ component = elms[41]
936
+ } else {
937
+ parent = elms[41][Symbol.for('children')][0]
1086
938
  }
1087
939
 
1088
940
  return elms
1089
941
  },
1090
942
  effects: [
1091
- function anonymous(component, elms, context, components) {
943
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1092
944
  elms[6].set('frame', component.fps[0])
1093
945
  },
1094
- function anonymous(component, elms, context, components) {
946
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1095
947
  elms[7][Symbol.for('props')]['frame'] = component.fps[0]
1096
948
  },
1097
- function anonymous(component, elms, context, components) {
949
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1098
950
  elms[8].set('frame', component.fps[1])
1099
951
  },
1100
- function anonymous(component, elms, context, components) {
952
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1101
953
  elms[9][Symbol.for('props')]['frame'] = component.fps[1]
1102
954
  },
1103
- function anonymous(component, elms, context, components) {
955
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1104
956
  elms[10].set('frame', component.fps[2])
1105
957
  },
1106
- function anonymous(component, elms, context, components) {
958
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1107
959
  elms[11][Symbol.for('props')]['frame'] = component.fps[2]
1108
960
  },
1109
- function anonymous(component, elms, context, components) {
961
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1110
962
  elms[16].set('frame', component.avgFps[0])
1111
963
  },
1112
- function anonymous(component, elms, context, components) {
964
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1113
965
  elms[17][Symbol.for('props')]['frame'] = component.avgFps[0]
1114
966
  },
1115
- function anonymous(component, elms, context, components) {
967
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1116
968
  elms[18].set('frame', component.avgFps[1])
1117
969
  },
1118
- function anonymous(component, elms, context, components) {
970
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1119
971
  elms[19][Symbol.for('props')]['frame'] = component.avgFps[1]
1120
972
  },
1121
- function anonymous(component, elms, context, components) {
973
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1122
974
  elms[20].set('frame', component.avgFps[2])
1123
975
  },
1124
- function anonymous(component, elms, context, components) {
976
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1125
977
  elms[21][Symbol.for('props')]['frame'] = component.avgFps[2]
1126
978
  },
1127
- function anonymous(component, elms, context, components) {
979
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1128
980
  elms[26].set('frame', component.minFps[0])
1129
981
  },
1130
- function anonymous(component, elms, context, components) {
982
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1131
983
  elms[27][Symbol.for('props')]['frame'] = component.minFps[0]
1132
984
  },
1133
- function anonymous(component, elms, context, components) {
985
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1134
986
  elms[28].set('frame', component.minFps[1])
1135
987
  },
1136
- function anonymous(component, elms, context, components) {
988
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1137
989
  elms[29][Symbol.for('props')]['frame'] = component.minFps[1]
1138
990
  },
1139
- function anonymous(component, elms, context, components) {
991
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1140
992
  elms[30].set('frame', component.minFps[2])
1141
993
  },
1142
- function anonymous(component, elms, context, components) {
994
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1143
995
  elms[31][Symbol.for('props')]['frame'] = component.minFps[2]
1144
996
  },
1145
- function anonymous(component, elms, context, components) {
997
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1146
998
  elms[36].set('frame', component.maxFps[0])
1147
999
  },
1148
- function anonymous(component, elms, context, components) {
1000
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1149
1001
  elms[37][Symbol.for('props')]['frame'] = component.maxFps[0]
1150
1002
  },
1151
- function anonymous(component, elms, context, components) {
1003
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1152
1004
  elms[38].set('frame', component.maxFps[1])
1153
1005
  },
1154
- function anonymous(component, elms, context, components) {
1006
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1155
1007
  elms[39][Symbol.for('props')]['frame'] = component.maxFps[1]
1156
1008
  },
1157
- function anonymous(component, elms, context, components) {
1009
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1158
1010
  elms[40].set('frame', component.maxFps[2])
1159
1011
  },
1160
- function anonymous(component, elms, context, components) {
1012
+ function anonymous(component, elms, context, components, rootComponent, effect) {
1161
1013
  elms[41][Symbol.for('props')]['frame'] = component.maxFps[2]
1162
1014
  },
1163
1015
  ],