diff --git a/src/tweens/events/TWEEN_PAUSE_EVENT.js b/src/tweens/events/TWEEN_PAUSE_EVENT.js new file mode 100644 index 000000000..c3bd271f8 --- /dev/null +++ b/src/tweens/events/TWEEN_PAUSE_EVENT.js @@ -0,0 +1,31 @@ +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Pause Event. + * + * This event is dispatched by a Tween when it is paused. + * + * Listen to it from a Tween instance using `Tween.on('pause', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.twe({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('pause', listener); + * // At some point later ... + * timeline.pause(); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_PAUSE + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + */ +module.exports = 'pause'; diff --git a/src/tweens/events/TWEEN_RESUME_EVENT.js b/src/tweens/events/TWEEN_RESUME_EVENT.js new file mode 100644 index 000000000..226b2f8e0 --- /dev/null +++ b/src/tweens/events/TWEEN_RESUME_EVENT.js @@ -0,0 +1,31 @@ +/** + * @author Richard Davey + * @copyright 2022 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Tween Resume Event. + * + * This event is dispatched by a Tween when it is resumed from a paused state. + * + * Listen to it from a Tween instance using `Tween.on('resume', listener)`, i.e.: + * + * ```javascript + * var timeline = this.tweens.timeline({ + * targets: image, + * ease: 'Power1', + * duration: 3000, + * tweens: [ { x: 600 }, { y: 500 }, { x: 100 }, { y: 100 } ] + * }); + * timeline.on('resume', listener); + * // At some point later ... + * timeline.resume(); + * ``` + * + * @event Phaser.Tweens.Events#TWEEN_RESUME + * @since 3.60.0 + * + * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. + */ +module.exports = 'resume'; diff --git a/src/tweens/events/index.js b/src/tweens/events/index.js index fe22c25a0..b383416a9 100644 --- a/src/tweens/events/index.js +++ b/src/tweens/events/index.js @@ -19,6 +19,8 @@ module.exports = { TWEEN_ACTIVE: require('./TWEEN_ACTIVE_EVENT'), TWEEN_COMPLETE: require('./TWEEN_COMPLETE_EVENT'), TWEEN_LOOP: require('./TWEEN_LOOP_EVENT'), + TWEEN_PAUSE: require('./TWEEN_PAUSE_EVENT'), + TWEEN_RESUME: require('./TWEEN_RESUME_EVENT'), TWEEN_REPEAT: require('./TWEEN_REPEAT_EVENT'), TWEEN_START: require('./TWEEN_START_EVENT'), TWEEN_STOP: require('./TWEEN_STOP_EVENT'),