Jump to content

Killing a Tween


jake.caron
 Share

Recommended Posts

Hi All,
I'm simply trying to kill/destroy a tween so it stops as soon as I call the method. I have tried the following code:
 

this.tweens.add({targets: this.titleGraphic, scaleX: 1, scaleY: 1, duration: 1000, ease: Phaser.Math.Easing.Back.Out});
this.tweens.killTweensOf(this.titleGraphic);

However, that does not seem to work. this.tweens.killAll(); also does not work. "this" is a reference to the current scene.

Thanks,
Jake.

Link to comment
Share on other sites

var tobeinterrupted = this.tweens.add({targets: this.titleGraphic, scaleX: 1, scaleY: 1, duration: 1000, ease: Phaser.Math.Easing.Back.Out});
tobeinterrupted.stop();

This is the controlled way to do it with single tween granularity. Anyhow both your ways should work too you should try better or more specific test cases

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...