@lightningjs/blits 1.16.2 → 1.17.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.
- package/.eslintrc.cjs +4 -0
- package/CHANGELOG.md +8 -0
- package/docs/essentials/displaying_text.md +11 -3
- package/index.d.ts +15 -1
- package/package.json +4 -2
- package/src/components/Circle.js +42 -41
- package/src/components/FPScounter.js +1284 -1334
- package/src/components/RouterView.js +22 -28
- package/src/components/Sprite.js +32 -35
- package/src/engines/L3/element.js +5 -0
- package/src/engines/L3/launch.js +2 -0
- package/src/launch.js +1 -1
|
@@ -22,36 +22,30 @@ let handler
|
|
|
22
22
|
|
|
23
23
|
export default () =>
|
|
24
24
|
Component('RouterView', {
|
|
25
|
-
/* eslint-disable no-unused-vars */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
/* eslint-disable no-unused-vars */
|
|
26
|
+
code: { render: function anonymous(parent,component,context,components,effect,getRaw
|
|
27
|
+
) {
|
|
28
|
+
const elms = []
|
|
29
|
+
let componentType
|
|
30
|
+
const rootComponent = component
|
|
31
|
+
let propData
|
|
32
|
+
let slotComponent
|
|
33
|
+
let inSlot = false
|
|
34
|
+
let slotChildCounter = 0
|
|
35
|
+
const elementConfig0 = {}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
elms[0] = this.element({parent: parent || 'root'}, inSlot === true ? slotComponent : component)
|
|
38
|
+
|
|
39
|
+
elementConfig0['w'] = parent.node.width * (100 / 100)
|
|
40
|
+
elementConfig0['height'] = parent.node.height * (100 / 100)
|
|
41
|
+
elms[0].populate(elementConfig0)
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return elms
|
|
51
|
-
},
|
|
52
|
-
effects: [],
|
|
53
|
-
context: {},
|
|
54
|
-
},
|
|
43
|
+
if(inSlot === true) {
|
|
44
|
+
slotChildCounter -= 1
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return elms
|
|
48
|
+
}, effects: [], context: {}},
|
|
55
49
|
state() {
|
|
56
50
|
return {
|
|
57
51
|
activeView: null,
|
package/src/components/Sprite.js
CHANGED
|
@@ -21,45 +21,42 @@ import symbols from '../lib/symbols.js'
|
|
|
21
21
|
|
|
22
22
|
export default () =>
|
|
23
23
|
Component('Sprite', {
|
|
24
|
-
/* eslint-disable no-unused-vars */
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
/* eslint-disable no-unused-vars */
|
|
25
|
+
code: { render: function anonymous(parent,component,context,components,effect,getRaw
|
|
26
|
+
) {
|
|
27
|
+
const elms = []
|
|
28
|
+
let componentType
|
|
29
|
+
const rootComponent = component
|
|
30
|
+
let propData
|
|
31
|
+
let slotComponent
|
|
32
|
+
let inSlot = false
|
|
33
|
+
let slotChildCounter = 0
|
|
34
|
+
const elementConfig0 = {}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
elms[0] = this.element({parent: parent || 'root'}, inSlot === true ? slotComponent : component)
|
|
37
|
+
|
|
38
|
+
elementConfig0['w'] = parent.node.width * (100 / 100)
|
|
39
|
+
elementConfig0['h'] = parent.node.height * (100 / 100)
|
|
40
|
+
elementConfig0['texture'] = component.texture
|
|
41
|
+
elementConfig0['color'] = component.color
|
|
42
|
+
elms[0].populate(elementConfig0)
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
if(inSlot === true) {
|
|
45
|
+
slotChildCounter -= 1
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return elms
|
|
49
|
+
}, effects: [function anonymous(component,elms,context,components,rootComponent,effect
|
|
50
|
+
) {
|
|
46
51
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
elms[0].set('texture', component.texture)
|
|
53
|
+
|
|
54
|
+
},function anonymous(component,elms,context,components,rootComponent,effect
|
|
55
|
+
) {
|
|
50
56
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
function anonymous(component, elms, context, components, rootComponent, effect) {
|
|
55
|
-
elms[0].set('texture', component.texture)
|
|
56
|
-
},
|
|
57
|
-
function anonymous(component, elms, context, components, rootComponent, effect) {
|
|
58
|
-
elms[0].set('color', component.color)
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
context: {},
|
|
62
|
-
},
|
|
57
|
+
elms[0].set('color', component.color)
|
|
58
|
+
|
|
59
|
+
}], context: {}},
|
|
63
60
|
props: ['image', 'map', 'frame', 'color'],
|
|
64
61
|
state() {
|
|
65
62
|
return {
|
|
@@ -355,6 +355,11 @@ const propsTransformer = {
|
|
|
355
355
|
this.props['fontSize'] = v
|
|
356
356
|
},
|
|
357
357
|
set wordwrap(v) {
|
|
358
|
+
Log.warn('The wordwrap attribute is deprecated, use maxwidth instead')
|
|
359
|
+
this.props['width'] = v
|
|
360
|
+
this.props['contain'] = 'width'
|
|
361
|
+
},
|
|
362
|
+
set maxwidth(v) {
|
|
358
363
|
this.props['width'] = v
|
|
359
364
|
this.props['contain'] = 'width'
|
|
360
365
|
},
|
package/src/engines/L3/launch.js
CHANGED
|
@@ -65,6 +65,8 @@ export default (App, target, settings = {}) => {
|
|
|
65
65
|
'gpuMemoryLimit' in settings ? settings.gpuMemoryLimit * 1024 * 1024 : 200 * 1024 * 1024,
|
|
66
66
|
renderEngine: renderEngine(settings),
|
|
67
67
|
fontEngines: textRenderEngines(settings),
|
|
68
|
+
canvas: settings.canvas,
|
|
69
|
+
textureProcessingLimit: settings.textureProcessingLimit
|
|
68
70
|
},
|
|
69
71
|
target
|
|
70
72
|
)
|
package/src/launch.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
import Settings from './settings.js'
|
|
19
19
|
import { initLog, Log } from './lib/log.js'
|
|
20
20
|
import engine from './engine.js'
|
|
21
|
-
import packageInfo from '../package.json'
|
|
21
|
+
import packageInfo from '../package.json' assert { type: 'json' }
|
|
22
22
|
|
|
23
23
|
export let renderer = {}
|
|
24
24
|
export const stage = {}
|