SteveB

Stopping chained tweens

Recommended Posts

I've set up a chain of tweens by chaining the 'to' method. e.g.

 this.tween.to({angle: 180}, 2000, Phaser.Easing.Linear.None).     to({x: 300}, 3000, Phaser.Easing.Linear.None);

but I need to be able to stop the tweens. If I call stop on the parent (this.tween) that stops it in its tracks but the other one then starts. How do I stop the entire chain.

 

I could write some manager to keep track of them but I'm sure that's not the way to do it. I saw the TweenManager has a removeAll but that looks like it would take out other chains as well.

 

Share this post


Link to post
Share on other sites

Hey Rich I had this problem before and found a topic where someone had said to set pendingDelete to true in the stop method, which seemed to work for me. Is there any reason you didn't do this?

 

Also, this is almost related,  I'm setting pendingPlayback to false with one of my sounds. Because calling stop on a sound that isn't ready to play means that when it is ready it still plays. Which is kind of problem when. For example, menu music plays in the game because the user presses play before the sound had loaded. In my case tutorial sound effects play when user skipped the tutorial. Is there any reason you didn't set pendingPlayback to false in the stop method?

Share this post


Link to post
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...

  • Recently Browsing   0 members

    No registered users viewing this page.