| Package | com.pblabs.animation |
| Class | public class AnimatorComponent |
| Inheritance | AnimatorComponent AnimatedComponent EntityComponent Object |
| Property | Defined By | ||
|---|---|---|---|
| animations : Dictionary = null
A list of all the animation that can be played by this component. | AnimatorComponent | ||
| autoPlay : Boolean = true
Whether or not to start the animation when the component is registered. | AnimatorComponent | ||
| defaultAnimation : String = Idle
The name of the animation to automatically start playing when the component
is registered. | AnimatorComponent | ||
![]() | isRegistered : Boolean [read-only]
Whether or not the component is currently registered with an entity. | EntityComponent | |
![]() | name : String [read-only]
The name given to the component when it is added to an entity. | EntityComponent | |
![]() | owner : IEntity
A reference to the entity that this component currently belongs to. | EntityComponent | |
| reference : PropertyReference = null
A reference to the property that will be animated. | AnimatorComponent | ||
![]() | registerForUpdates : Boolean
Set to register/unregister for frame updates. | AnimatedComponent | |
![]() | updatePriority : Number = 0.0
The update priority for this component. | AnimatedComponent | |
| Method | Defined By | ||
|---|---|---|---|
onFrame(elapsed:Number):void [override]
This method is called every frame by the ProcessManager on any objects
that have been added to it with the AddAnimatedObject method. | AnimatorComponent | ||
play(animation:String, startValue:* = null):void
Plays an animation that is on this component. | AnimatorComponent | ||
![]() |
Registers the component with an entity. | EntityComponent | |
![]() | reset():void
This is called by an entity on all of its components any time a component
is added or removed. | EntityComponent | |
![]() | unregister():void
Unregisters the component from an entity. | EntityComponent | |
| Method | Defined By | ||
|---|---|---|---|
![]() | onAdd():void [override] | AnimatedComponent | |
![]() | onRemove():void [override] | AnimatedComponent | |
onReset():void [override]
This is called anytime a component is added or removed from the owner entity. | AnimatorComponent | ||
| animations | property |
public var animations:Dictionary = nullA list of all the animation that can be played by this component.
| autoPlay | property |
public var autoPlay:Boolean = trueWhether or not to start the animation when the component is registered.
| defaultAnimation | property |
public var defaultAnimation:String = IdleThe name of the animation to automatically start playing when the component is registered.
| reference | property |
public var reference:PropertyReference = nullA reference to the property that will be animated.
| onFrame | () | method |
override public function onFrame(elapsed:Number):voidThis method is called every frame by the ProcessManager on any objects that have been added to it with the AddAnimatedObject method.
Parameters
elapsed:Number — The amount of time (in seconds) that has elapsed since
the last frame.
|
| onReset | () | method |
override protected function onReset():voidThis is called anytime a component is added or removed from the owner entity. Lookups of other components on the owner entity should happen here.
This can potentially be called multiple times, so make sure previous lookups are properly cleaned up each time.
| play | () | method |
public function play(animation:String, startValue:* = null):voidPlays an animation that is on this component.
Parameters
animation:String — The name of the animation in the Animations dictionary
to play.
| |
startValue:* (default = null) — The value to start at. If this is null (the default), the
start value won't be changed.
|