Jump to content

Stopping chained tweens


SteveB
 Share

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.

 

Link to comment
Share on other sites

  • 2 weeks later...

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?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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