feat: visible rotation

This commit is contained in:
cha0s 2019-11-03 10:38:33 -06:00
parent 5072bbb718
commit 060177f1e8

View File

@ -19,6 +19,9 @@ const decorate = compose(
StateProperty('opacity', {
track: true,
}),
StateProperty('rotation', {
track: true,
}),
StateProperty('visibleScale', {
track: true,
}),
@ -40,6 +43,7 @@ export class Visible extends decorate(Trait) {
return {
isVisible: true,
opacity: 1,
rotation: 0,
visibleScale: [1, 1],
zIndex: AUTO_ZINDEX,
};
@ -163,6 +167,13 @@ export class Visible extends decorate(Trait) {
this.translateVisibleAabb();
},
rotationChanged: () => {
if (!this._container) {
return;
}
this._container.rotation = this.entity.rotation;
},
traitAdded: (type) => {
if (-1 === [
'visible',