Phaser API Documentation

  Version: 
stopAfterRepeat([repeatCount])

Description:

Stops the current animation from playing when it next repeats.

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.

Prior to Phaser 3.50 this method was called stopOnRepeat and had no parameters.

Parameters:

name type arguments Default description
repeatCount number <optional> 1

How many times should the animation repeat before stopping?

Returns:
Description:

The Game Object that owns this Animation Component.

Since: 3.50.0