ActorAnimation

ActorAnimation Animates actor transformations.

Constructor

new ActorAnimation(tracks, length, play, once, loop)

Create a new actor animation.
Parameters:
NameTypeDescription
tracksArray.<ActorAnimationTrack>List of tracks to add
lengthnumberDuration of animation
playbooleanWhether to play on adding to actor (true by default)
oncebooleanWhether to delete after completion (true by default)
loopbooleanWhether 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:
NameTypeDefaultDescription
progressnumber0Percentage to start playback at (0 - 1, 0 by default)

stop()

Stop playing the animation.

update(elapsed)

Update all tracks in the animations.
Parameters:
NameTypeDescription
elapsednumberTime since last update cycle in seconds