TransformComponent
Hierarchy
- Component
- TransformComponent
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Returns TransformComponent
Properties
optionalreadonlydependencies
Optionally list any component types this component depends on If the owner entity does not have these components, new components will be added to the entity
Only components with zero-arg constructors are supported as automatic component dependencies
optionalowner
Current owning [[Entity]], if any, of this component. Null if not added to any [[Entity]]
publiczIndexChanged$
Observable that emits when the z index changes on this component
Accessors
publiccoordPlane
The [[CoordPlane|coordinate plane|]] for this transform for the entity.
Returns CoordPlane
Parameters
value: CoordPlane
Returns void
globalPos
globalRotation
Returns number
Parameters
rotation: number
Returns void
globalScale
pos
rotation
Returns number
Parameters
rotation: number
Returns void
scale
publicz
The z-index ordering of the entity, a higher values are drawn on top of lower values. For example z=99 would be drawn on top of z=0.
Returns number
Parameters
val: number
Returns void
Methods
apply
applyInverse
clone
Clones any properties on this component, if that property value has a
clone()
method it will be calledReturns TransformComponent
publicget
Returns Transform
onAdd
Optional callback called when a component is added to an entity
Parameters
owner: Entity<any>
Returns void
onRemove
Optional callback called when a component is removed from an entity
Parameters
_previousOwner: Entity<any>
Returns void
Components are containers for state in Excalibur, the are meant to convey capabilities that an Entity possesses
Implementations of Component must have a zero-arg constructor to support dependencies