Tween#repeat()

repeat(total, repeat, index) → {Phaser.Tween}

Sets the number of times this tween will repeat.
If you have not yet called Tween.to or Tween.from at least once then this method will do nothing, as there are no tweens to repeat.
If you have child tweens and pass -1 as the index value it sets the number of times they'll repeat across all of them.
If you wish to define how many times this Tween and all children will repeat see Tween.repeatAll.

Parameters
Name Type Argument Default Description
total number

How many times a tween should repeat before completing. Set to zero to remove an active repeat. Set to -1 to repeat forever.

repeat number <optional>
0

This is the amount of time to pause (in ms) before the repeat will start.

index number <optional>
0

If this tween has more than one child this allows you to target a specific child. If set to -1 it will set the repeat value on all the children.

Returns

This tween. Useful for method chaining.

Source code: tween/Tween.js (Line 425)
doc_phaser
2017-02-14 11:18:38
Comments
Leave a Comment

Please login to continue.