From 34bf26592e922ca2ef53d76753dfa5eccf97ac13 Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Thu, 27 Jun 2019 01:37:36 +0100 Subject: [PATCH] Fixed missing loop callback --- src/tweens/tween/Tween.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/tweens/tween/Tween.js b/src/tweens/tween/Tween.js index 1e12231bb..c5bf19175 100644 --- a/src/tweens/tween/Tween.js +++ b/src/tweens/tween/Tween.js @@ -633,6 +633,7 @@ var Tween = new Class({ * Internal method that advances to the next state of the Tween during playback. * * @method Phaser.Tweens.Tween#nextState + * @fires Phaser.Tweens.Events#TWEEN_LOOP * @fires Phaser.Tweens.Events#TWEEN_COMPLETE * @since 3.0.0 */ @@ -653,6 +654,17 @@ var Tween = new Class({ } else { + this.emit(Events.TWEEN_LOOP, this, this.targets); + + var onLoop = this.callbacks.onLoop; + + if (onLoop) + { + onLoop.params[1] = this.targets; + + onLoop.func.apply(onLoop.scope, onLoop.params); + } + this.state = TWEEN_CONST.ACTIVE; } }