Jump to content

Stop Chained Tweens


luschn
 Share

Recommended Posts

I got a tiny problem with chained tweens, i hope anybody can help me:

var tween = game.add.tween(mySprite).to({someoptions}, 1000, Phaser.Easing.Linear.None)    .to({someoptions}, 1000, Phaser.Easing.Linear.None)    .to({someoptions}, 1000, Phaser.Easing.Linear.None)    .start();

Now what i want to do is to completely stop the whole chain while it runs, and restart it from the beginning. I did this with the following code:

game.tweens.removeAll();

(game is the Phaser instance, of course)

 

The tween gets stopped indeed and the sprite does not move anymore - but when i create a new tween chain right after "removeAll" it does not start immediately. Instead, the sprite stands still for a while (as if the other tween chain would still run in the background but with no visible effect) and the new tween chain runs smoothly after that time.

 

I hope my explanation was understandable :)

Link to comment
Share on other sites

  • 1 month later...

I think that pause let run the tween to the end before pausing . With resume you restart from the beginning . But anyway losing window focus a and getting back act strangely on pause .. check the pause example (phaser).

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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