Constructor
new ActorAnimation(tracks, length, play, once, loop)
Create a new actor animation.
Parameters:
Name | Type | Description |
---|---|---|
tracks | Array.<ActorAnimationTrack> | List of tracks to add |
length | number | Duration of animation |
play | boolean | Whether to play on adding to actor (true by default) |
once | boolean | Whether to delete after completion (true by default) |
loop | boolean | Whether to loop after completion (false by default) |
Members
actor
Get the actor the animation is attached to.
actor
Set the actor for the animation.
done
Check if the animation has completed.
Methods
hasPosition() → {boolean}
Check if the animation has any position tracks.
Returns:
Whether animation has at least one position track
- Type:
- boolean
hasRotation() → {boolean}
Check if the animation has any rotation tracks.
Returns:
Whether animation has at least one rotation track
- Type:
- boolean
hasScale() → {boolean}
Check if the animation has any scale tracks.
Returns:
Whether animation has at least one scale track
- Type:
- boolean
play(progress)
Start the animation.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
progress | number | 0 | Percentage to start playback at (0 - 1, 0 by default) |
stop()
Stop playing the animation.
update(elapsed)
Update all tracks in the animations.
Parameters:
Name | Type | Description |
---|---|---|
elapsed | number | Time since last update cycle in seconds |