This event is dispatched by a Sprite when an animation playing on it completes playback.
This happens when the animation gets to the end of its sequence, factoring in any delays
or repeats it may have to process.
An animation that is set to loop, or repeat forever, will never fire this event, because
it never actually completes. If you need to handle this, listen for the ANIMATION_STOP
event instead, as this is emitted when the animation is stopped directly.
Listen for it on the Sprite using sprite.on('animationcomplete', listener)
The animation event flow is as follows:
ANIMATION_START
ANIMATION_UPDATE (repeated for however many frames the animation has)
ANIMATION_REPEAT (only if the animation is set to repeat, it then emits more update events after this)
ANIMATION_COMPLETE (only if there is a finite, or zero, repeat count)
ANIMATION_COMPLETE_KEY (only if there is a finite, or zero, repeat count)
If the animation is stopped directly, the ANIMATION_STOP event is dispatched instead of ANIMATION_COMPLETE.
If the animation is restarted while it is already playing, ANIMATION_RESTART is emitted.
The Animation Complete Event.
This event is dispatched by a Sprite when an animation playing on it completes playback. This happens when the animation gets to the end of its sequence, factoring in any delays or repeats it may have to process.
An animation that is set to loop, or repeat forever, will never fire this event, because it never actually completes. If you need to handle this, listen for the
ANIMATION_STOPevent instead, as this is emitted when the animation is stopped directly.Listen for it on the Sprite using
sprite.on('animationcomplete', listener)The animation event flow is as follows:
ANIMATION_STARTANIMATION_UPDATE(repeated for however many frames the animation has)ANIMATION_REPEAT(only if the animation is set to repeat, it then emits more update events after this)ANIMATION_COMPLETE(only if there is a finite, or zero, repeat count)ANIMATION_COMPLETE_KEY(only if there is a finite, or zero, repeat count)If the animation is stopped directly, the
ANIMATION_STOPevent is dispatched instead ofANIMATION_COMPLETE.If the animation is restarted while it is already playing,
ANIMATION_RESTARTis emitted.