feat: visible rotation
This commit is contained in:
parent
5072bbb718
commit
060177f1e8
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue
Block a user