Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Chained Tweens OnComplete


Monstamash
 Share

Recommended Posts

Hi All

 

I don't know if this is a bug, or my understanding of how it should work, but I would like to call a function at the end of a chained set of tweens.

 

I have the below code, but the function gets called at the end of the first tween, not the end of the last one. Is there a way to call at the end of the last?

var tween = game.add.tween(text);  tween.to( { x:text.x+10 }, 1000, Phaser.Easing.Linear.None)  .to( { x:text.x-20 }, 1000, Phaser.Easing.Linear.None)  .to( { x:text.x+20 }, 1000, Phaser.Easing.Linear.None)  .to( { x:text.x-20 }, 1000, Phaser.Easing.Linear.None)  .to( { x:text.x+10 }, 1000, Phaser.Easing.Linear.None);  tween.onComplete.add(sayHello, this);  tween.start();
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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