Jump to content

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


threedollarbill
 Share

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);
fishTween.start();

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)
this.removeAll(true);

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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