Skip to content

Commit a799f5a

Browse files
committed
Added Tween.remove method.
1 parent b635458 commit a799f5a

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

src/tweens/tween/Tween.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,13 +898,32 @@ var Tween = new Class({
898898
return this;
899899
},
900900

901+
/**
902+
* Immediately removes this Tween from the TweenManager and all of its internal arrays,
903+
* no matter what stage it as it. Then sets the tween state to `REMOVED`.
904+
*
905+
* You should dispose of your reference to this tween after calling this method, to
906+
* free it from memory.
907+
*
908+
* @method Phaser.Tweens.Tween#remove
909+
* @since 3.17.0
910+
*
911+
* @return {this} This Tween instance.
912+
*/
913+
remove: function ()
914+
{
915+
this.parent.remove(this);
916+
917+
return this;
918+
},
919+
901920
/**
902921
* Stops the Tween immediately, whatever stage of progress it is at and flags it for removal by the TweenManager.
903922
*
904923
* @method Phaser.Tweens.Tween#stop
905924
* @since 3.0.0
906925
*
907-
* @param {number} [resetTo] - A value between 0 and 1.
926+
* @param {number} [resetTo] - If you want to seek the tween, provide an value between 0 and 1.
908927
*
909928
* @return {this} This Tween instance.
910929
*/

0 commit comments

Comments
 (0)