fix: visible scale
This commit is contained in:
parent
36e5fbbb85
commit
cf7487a104
|
@ -156,7 +156,7 @@ export class Pictured extends decorate(Trait) {
|
|||
this.showImage(this.entity.currentImage);
|
||||
},
|
||||
|
||||
scaleChanged: () => {
|
||||
visibleScaleChanged: () => {
|
||||
this.setSpriteScale();
|
||||
},
|
||||
|
||||
|
|
|
@ -79,6 +79,22 @@ export class Visible extends decorate(Trait) {
|
|||
this.entity.container.zIndex = this.entity.y;
|
||||
}
|
||||
|
||||
get visibleScaleX() {
|
||||
return this.entity.visibleScale.get(0);
|
||||
}
|
||||
|
||||
set visibleScaleX(x) {
|
||||
this.rawVisibleScale = [x, this.visibleScaleY];
|
||||
}
|
||||
|
||||
get visibleScaleY() {
|
||||
return this.entity.visibleScale.get(1);
|
||||
}
|
||||
|
||||
set visibleScaleY(y) {
|
||||
this.rawVisibleScale = [this.visibleScaleX, y];
|
||||
}
|
||||
|
||||
listeners() {
|
||||
const listeners = {
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ class AnimatedBase extends Trait {
|
|||
this._isAnimating = false;
|
||||
},
|
||||
|
||||
scaleChanged: () => {
|
||||
visibleScaleChanged: () => {
|
||||
this.setSpriteScale();
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user