@lightningjs/blits 1.8.1 → 1.8.2
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.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/components/Circle.js +1 -0
- package/src/components/FPScounter.js +61 -12
- package/src/components/Layout.js +1 -0
- package/src/components/RouterView.js +1 -0
- package/src/components/Sprite.js +1 -0
- package/src/lib/codegenerator/generator.js +11 -5
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/components/Circle.js
CHANGED
|
@@ -27,6 +27,7 @@ export default () =>
|
|
|
27
27
|
const elms = []
|
|
28
28
|
let componentType
|
|
29
29
|
const rootComponent = component
|
|
30
|
+
let propData
|
|
30
31
|
const elementConfig0 = {}
|
|
31
32
|
|
|
32
33
|
elms[0] = this.element({ parent: parent || 'root' }, component)
|
|
@@ -142,7 +143,11 @@ export default () =>
|
|
|
142
143
|
props7['w'] = 20
|
|
143
144
|
props7['map'] = component.sprite
|
|
144
145
|
|
|
145
|
-
|
|
146
|
+
propData = component.fps[0]
|
|
147
|
+
if (Array.isArray(propData) === true) {
|
|
148
|
+
propData = getRaw(propData).slice(0)
|
|
149
|
+
}
|
|
150
|
+
props7['frame'] = propData
|
|
146
151
|
|
|
147
152
|
componentType = props7['is'] || 'Sprite'
|
|
148
153
|
|
|
@@ -200,7 +205,11 @@ export default () =>
|
|
|
200
205
|
props9['w'] = 20
|
|
201
206
|
props9['map'] = component.sprite
|
|
202
207
|
|
|
203
|
-
|
|
208
|
+
propData = component.fps[1]
|
|
209
|
+
if (Array.isArray(propData) === true) {
|
|
210
|
+
propData = getRaw(propData).slice(0)
|
|
211
|
+
}
|
|
212
|
+
props9['frame'] = propData
|
|
204
213
|
|
|
205
214
|
componentType = props9['is'] || 'Sprite'
|
|
206
215
|
|
|
@@ -258,7 +267,11 @@ export default () =>
|
|
|
258
267
|
props11['w'] = 20
|
|
259
268
|
props11['map'] = component.sprite
|
|
260
269
|
|
|
261
|
-
|
|
270
|
+
propData = component.fps[2]
|
|
271
|
+
if (Array.isArray(propData) === true) {
|
|
272
|
+
propData = getRaw(propData).slice(0)
|
|
273
|
+
}
|
|
274
|
+
props11['frame'] = propData
|
|
262
275
|
|
|
263
276
|
componentType = props11['is'] || 'Sprite'
|
|
264
277
|
|
|
@@ -390,7 +403,11 @@ export default () =>
|
|
|
390
403
|
props17['w'] = 20
|
|
391
404
|
props17['map'] = component.sprite
|
|
392
405
|
|
|
393
|
-
|
|
406
|
+
propData = component.avgFps[0]
|
|
407
|
+
if (Array.isArray(propData) === true) {
|
|
408
|
+
propData = getRaw(propData).slice(0)
|
|
409
|
+
}
|
|
410
|
+
props17['frame'] = propData
|
|
394
411
|
|
|
395
412
|
componentType = props17['is'] || 'Sprite'
|
|
396
413
|
|
|
@@ -448,7 +465,11 @@ export default () =>
|
|
|
448
465
|
props19['w'] = 20
|
|
449
466
|
props19['map'] = component.sprite
|
|
450
467
|
|
|
451
|
-
|
|
468
|
+
propData = component.avgFps[1]
|
|
469
|
+
if (Array.isArray(propData) === true) {
|
|
470
|
+
propData = getRaw(propData).slice(0)
|
|
471
|
+
}
|
|
472
|
+
props19['frame'] = propData
|
|
452
473
|
|
|
453
474
|
componentType = props19['is'] || 'Sprite'
|
|
454
475
|
|
|
@@ -506,7 +527,11 @@ export default () =>
|
|
|
506
527
|
props21['w'] = 20
|
|
507
528
|
props21['map'] = component.sprite
|
|
508
529
|
|
|
509
|
-
|
|
530
|
+
propData = component.avgFps[2]
|
|
531
|
+
if (Array.isArray(propData) === true) {
|
|
532
|
+
propData = getRaw(propData).slice(0)
|
|
533
|
+
}
|
|
534
|
+
props21['frame'] = propData
|
|
510
535
|
|
|
511
536
|
componentType = props21['is'] || 'Sprite'
|
|
512
537
|
|
|
@@ -639,7 +664,11 @@ export default () =>
|
|
|
639
664
|
props27['w'] = 20
|
|
640
665
|
props27['map'] = component.sprite
|
|
641
666
|
|
|
642
|
-
|
|
667
|
+
propData = component.minFps[0]
|
|
668
|
+
if (Array.isArray(propData) === true) {
|
|
669
|
+
propData = getRaw(propData).slice(0)
|
|
670
|
+
}
|
|
671
|
+
props27['frame'] = propData
|
|
643
672
|
|
|
644
673
|
componentType = props27['is'] || 'Sprite'
|
|
645
674
|
|
|
@@ -697,7 +726,11 @@ export default () =>
|
|
|
697
726
|
props29['w'] = 20
|
|
698
727
|
props29['map'] = component.sprite
|
|
699
728
|
|
|
700
|
-
|
|
729
|
+
propData = component.minFps[1]
|
|
730
|
+
if (Array.isArray(propData) === true) {
|
|
731
|
+
propData = getRaw(propData).slice(0)
|
|
732
|
+
}
|
|
733
|
+
props29['frame'] = propData
|
|
701
734
|
|
|
702
735
|
componentType = props29['is'] || 'Sprite'
|
|
703
736
|
|
|
@@ -755,7 +788,11 @@ export default () =>
|
|
|
755
788
|
props31['w'] = 20
|
|
756
789
|
props31['map'] = component.sprite
|
|
757
790
|
|
|
758
|
-
|
|
791
|
+
propData = component.minFps[2]
|
|
792
|
+
if (Array.isArray(propData) === true) {
|
|
793
|
+
propData = getRaw(propData).slice(0)
|
|
794
|
+
}
|
|
795
|
+
props31['frame'] = propData
|
|
759
796
|
|
|
760
797
|
componentType = props31['is'] || 'Sprite'
|
|
761
798
|
|
|
@@ -886,7 +923,11 @@ export default () =>
|
|
|
886
923
|
props37['w'] = 20
|
|
887
924
|
props37['map'] = component.sprite
|
|
888
925
|
|
|
889
|
-
|
|
926
|
+
propData = component.maxFps[0]
|
|
927
|
+
if (Array.isArray(propData) === true) {
|
|
928
|
+
propData = getRaw(propData).slice(0)
|
|
929
|
+
}
|
|
930
|
+
props37['frame'] = propData
|
|
890
931
|
|
|
891
932
|
componentType = props37['is'] || 'Sprite'
|
|
892
933
|
|
|
@@ -944,7 +985,11 @@ export default () =>
|
|
|
944
985
|
props39['w'] = 20
|
|
945
986
|
props39['map'] = component.sprite
|
|
946
987
|
|
|
947
|
-
|
|
988
|
+
propData = component.maxFps[1]
|
|
989
|
+
if (Array.isArray(propData) === true) {
|
|
990
|
+
propData = getRaw(propData).slice(0)
|
|
991
|
+
}
|
|
992
|
+
props39['frame'] = propData
|
|
948
993
|
|
|
949
994
|
componentType = props39['is'] || 'Sprite'
|
|
950
995
|
|
|
@@ -1002,7 +1047,11 @@ export default () =>
|
|
|
1002
1047
|
props41['w'] = 20
|
|
1003
1048
|
props41['map'] = component.sprite
|
|
1004
1049
|
|
|
1005
|
-
|
|
1050
|
+
propData = component.maxFps[2]
|
|
1051
|
+
if (Array.isArray(propData) === true) {
|
|
1052
|
+
propData = getRaw(propData).slice(0)
|
|
1053
|
+
}
|
|
1054
|
+
props41['frame'] = propData
|
|
1006
1055
|
|
|
1007
1056
|
componentType = props41['is'] || 'Sprite'
|
|
1008
1057
|
|
package/src/components/Layout.js
CHANGED
package/src/components/Sprite.js
CHANGED
|
@@ -19,7 +19,12 @@ let counter
|
|
|
19
19
|
|
|
20
20
|
export default function (templateObject = { children: [] }) {
|
|
21
21
|
const ctx = {
|
|
22
|
-
renderCode: [
|
|
22
|
+
renderCode: [
|
|
23
|
+
'const elms = []',
|
|
24
|
+
'let componentType',
|
|
25
|
+
'const rootComponent = component',
|
|
26
|
+
'let propData',
|
|
27
|
+
],
|
|
23
28
|
effectsCode: [],
|
|
24
29
|
context: { props: [], components: this.components },
|
|
25
30
|
}
|
|
@@ -213,10 +218,11 @@ const generateComponentCode = function (
|
|
|
213
218
|
options.component
|
|
214
219
|
)}`)
|
|
215
220
|
renderCode.push(`
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
221
|
+
propData = ${interpolate(templateObject[key], options.component)}
|
|
222
|
+
if (Array.isArray(propData) === true) {
|
|
223
|
+
propData = getRaw(propData).slice(0)
|
|
224
|
+
}
|
|
225
|
+
props${counter}['${key.substring(1)}'] = propData`)
|
|
220
226
|
} else {
|
|
221
227
|
renderCode.push(
|
|
222
228
|
`props${counter}['${key}'] = ${cast(templateObject[key], key, options.component)}`
|