@lightningjs/blits 0.6.2 → 0.6.4
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 +13 -0
- package/boilerplate/package.json +1 -1
- package/package.json +1 -1
- package/src/components/Sprite.js +3 -5
- package/src/element.js +4 -0
package/CHANGELOG.md
CHANGED
package/boilerplate/package.json
CHANGED
package/package.json
CHANGED
package/src/components/Sprite.js
CHANGED
|
@@ -22,7 +22,7 @@ import symbols from '../lib/symbols.js'
|
|
|
22
22
|
export default () =>
|
|
23
23
|
Component('Sprite', {
|
|
24
24
|
template: `
|
|
25
|
-
<Element w="$w" h="$h"
|
|
25
|
+
<Element w="$w" h="$h" :texture="$texture" />
|
|
26
26
|
`,
|
|
27
27
|
props: ['image', 'map', 'frame', 'w', 'h'],
|
|
28
28
|
state() {
|
|
@@ -32,10 +32,9 @@ export default () =>
|
|
|
32
32
|
},
|
|
33
33
|
computed: {
|
|
34
34
|
texture() {
|
|
35
|
-
console.log('texture')
|
|
36
35
|
const options =
|
|
37
36
|
'frames' in this.map
|
|
38
|
-
? {
|
|
37
|
+
? Object.assign({}, this.map.defaults || {}, this.map.frames[this.frame])
|
|
39
38
|
: this.map[this.frame]
|
|
40
39
|
|
|
41
40
|
if (this.spriteTexture && options) {
|
|
@@ -51,9 +50,8 @@ export default () =>
|
|
|
51
50
|
},
|
|
52
51
|
hooks: {
|
|
53
52
|
ready() {
|
|
54
|
-
console.log('sprite!')
|
|
55
53
|
this.spriteTexture = this[symbols.renderer].createTexture('ImageTexture', {
|
|
56
|
-
src:
|
|
54
|
+
src: this.image,
|
|
57
55
|
})
|
|
58
56
|
},
|
|
59
57
|
},
|
package/src/element.js
CHANGED
|
@@ -119,6 +119,9 @@ const Props = {
|
|
|
119
119
|
},
|
|
120
120
|
set texture(v) {
|
|
121
121
|
this._props.texture = v
|
|
122
|
+
if (!this._set.has('color')) {
|
|
123
|
+
this._props.color = 0xffffffff
|
|
124
|
+
}
|
|
122
125
|
this._set.add('texture')
|
|
123
126
|
},
|
|
124
127
|
set mount(v) {
|
|
@@ -263,6 +266,7 @@ const Element = {
|
|
|
263
266
|
return this.animate(p, v, value.transition)
|
|
264
267
|
} else {
|
|
265
268
|
this.node[p] = v
|
|
269
|
+
console.log('set it', this.node[p], v)
|
|
266
270
|
}
|
|
267
271
|
}
|
|
268
272
|
},
|