Jump to content

Does destroying a sprite also destroy (remove / dispose) its tween?


Recommended Posts

If I have a sprite and I started tweening it, maybe by doing something like..

// create mrFish sprite, add it to this group and begin animating it
let mrFish:Phaser.Sprite = this.create(0, 0, "myAtlas", "fish");
let fishTween:Phaser.Tween = this.game.add.tween(mrFish.position);
fishTween.to({x: 500}, 3000, Phaser.Easing.Linear.None, false, 0, 0, false);

Let's say before the tween even finishes, I decide to destroy the object.. Does that automatically take care of the tween and dispose it too?

// remove and destroy all sprites in this group (including mrFish)


Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...