fix: visible scale

This commit is contained in:
cha0s 2019-04-19 17:09:48 -05:00
parent 36e5fbbb85
commit cf7487a104
3 changed files with 18 additions and 2 deletions

View File

@ -156,7 +156,7 @@ export class Pictured extends decorate(Trait) {
this.showImage(this.entity.currentImage);
},
scaleChanged: () => {
visibleScaleChanged: () => {
this.setSpriteScale();
},

View File

@ -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 = {

View File

@ -202,7 +202,7 @@ class AnimatedBase extends Trait {
this._isAnimating = false;
},
scaleChanged: () => {
visibleScaleChanged: () => {
this.setSpriteScale();
},