Const
The Animation Restart Event.
This event is dispatched by a Sprite when an animation restarts playing on it. This only happens when the Sprite.anims.restart method is called.
Sprite.anims.restart
Listen for it on the Sprite using sprite.on('animationrestart', listener)
sprite.on('animationrestart', listener)
The animation event flow is as follows:
ANIMATION_START
ANIMATION_UPDATE
ANIMATION_REPEAT
ANIMATION_COMPLETE
ANIMATION_COMPLETE_KEY
If the animation is stopped directly, the ANIMATION_STOP event is dispatched instead of ANIMATION_COMPLETE.
ANIMATION_STOP
If the animation is restarted while it is already playing, ANIMATION_RESTART is emitted.
ANIMATION_RESTART
The Animation Restart Event.
This event is dispatched by a Sprite when an animation restarts playing on it. This only happens when the
Sprite.anims.restartmethod is called.Listen for it on the Sprite using
sprite.on('animationrestart', 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.