Phaser API Documentation

  Version: 
stopOnFrame(frame)

Description:

Stops the current animation from playing when it next sets the given frame. If this frame doesn't exist within the animation it will not stop it from playing.

It then dispatches the ANIMATION_STOP event.

If no animation is running, no events will be dispatched.

If there is another animation in the queue (set via the chain method) then it will start playing, when the current one stops.

Parameters:

name type description
frame Phaser.Animations.AnimationFrame

The frame to check before stopping this animation.

Returns:
Description:

This Game Object.

Examples:
Since: 3.50.0