phaser/src/tweens/events/TWEEN_REPEAT_EVENT.js

40 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-06-27 00:00:37 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
2022-02-28 14:29:51 +00:00
* @copyright 2022 Photon Storm Ltd.
2019-06-27 00:00:37 +00:00
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
/**
* The Tween Repeat Event.
2022-02-28 14:29:51 +00:00
*
2019-06-27 00:00:37 +00:00
* This event is dispatched by a Tween when one of the properties it is tweening repeats.
2022-02-28 14:29:51 +00:00
*
2019-06-27 00:00:37 +00:00
* This event will only be dispatched if the Tween has a property with a repeat count set.
2022-02-28 14:29:51 +00:00
*
2019-06-27 00:00:37 +00:00
* If a Tween has a `repeatDelay` set, this event will fire after that delay expires.
2022-02-28 14:29:51 +00:00
*
2019-06-27 00:00:37 +00:00
* The difference between `loop` and `repeat` is that `repeat` is a property setting,
* where-as `loop` applies to the entire Tween.
2022-02-28 14:29:51 +00:00
*
2019-06-27 00:00:37 +00:00
* Listen to it from a Tween instance using `Tween.on('repeat', listener)`, i.e.:
2022-02-28 14:29:51 +00:00
*
2019-06-27 00:00:37 +00:00
* ```javascript
* var tween = this.tweens.add({
* targets: image,
* x: 500,
* ease: 'Power1',
* duration: 3000,
* repeat: 4
* });
* tween.on('repeat', listener);
* ```
*
* @event Phaser.Tweens.Events#TWEEN_REPEAT
* @since 3.19.0
2022-02-28 14:29:51 +00:00
*
2019-06-27 00:00:37 +00:00
* @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event.
* @param {string} key - The key of the property that just repeated.
2019-10-29 06:33:37 +00:00
* @param {any} target - The target that the property just repeated on.
2019-06-27 00:00:37 +00:00
*/
module.exports = 'repeat';