Phaser API Documentation

  Version: 
setRepeat(value)

Description:

Sets the number of times that the animation should repeat after its first play through. For example, if repeat is 1, the animation will play a total of twice: the initial play plus 1 repeat.

To repeat indefinitely, use -1. The value should always be an integer.

Calling this method only works if the animation is already running. Otherwise, any value specified here will be overwritten when the next animation loads in. To avoid this, use the repeat property of the PlayAnimationConfig object instead.

Parameters:

name type description
value number

The number of times that the animation should repeat.

Returns:
Description:

The Game Object that owns this Animation Component.

Since: 3.4.0