Packagecom.pblabs.animation
Classpublic class AnimatorComponent
InheritanceAnimatorComponent Inheritance AnimatedComponent Inheritance EntityComponent Inheritance Object

Component for animating any value on its owner.



Public Properties
 PropertyDefined 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
 InheritedisRegistered : Boolean
[read-only] Whether or not the component is currently registered with an entity.
EntityComponent
 Inheritedname : String
[read-only] The name given to the component when it is added to an entity.
EntityComponent
 Inheritedowner : 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
 InheritedregisterForUpdates : Boolean
Set to register/unregister for frame updates.
AnimatedComponent
 InheritedupdatePriority : Number = 0.0
The update priority for this component.
AnimatedComponent
Public Methods
 MethodDefined 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
 Inherited
register(owner:IEntity, name:String):void
Registers the component with an entity.
EntityComponent
 Inherited
reset():void
This is called by an entity on all of its components any time a component is added or removed.
EntityComponent
 Inherited
unregister():void
Unregisters the component from an entity.
EntityComponent
Protected Methods
 MethodDefined By
 Inherited
onAdd():void
[override]
AnimatedComponent
 Inherited
onRemove():void
[override]
AnimatedComponent
  
onReset():void
[override] This is called anytime a component is added or removed from the owner entity.
AnimatorComponent
Property Detail
animationsproperty
public var animations:Dictionary = null

A list of all the animation that can be played by this component.

autoPlayproperty 
public var autoPlay:Boolean = true

Whether or not to start the animation when the component is registered.

defaultAnimationproperty 
public var defaultAnimation:String = Idle

The name of the animation to automatically start playing when the component is registered.

referenceproperty 
public var reference:PropertyReference = null

A reference to the property that will be animated.

Method Detail
onFrame()method
override public function onFrame(elapsed:Number):void

This 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():void

This 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):void

Plays 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.