Pomdap Posted September 21, 2014 Share Posted September 21, 2014 Hi, I was looking at the chained tweens example and I tryed to add an onCompete event at the end of the tween but it's look like the event is dispatched after the end of the first tween.var tween = this.game.add.tween(this.phaser).to({ alpha: 1 }, 1000, Phaser.Easing.Sinusoidal.InOut, true).to({ alpha: 0 }, 1000, Phaser.Easing.Sinusoidal.InOut, false, 1000).onComplete.add(this.onAnimationDone, this);I found this solution on the forum wich is not ellegant, but at least functional:var tween = this.game.add.tween(this.phaser).to({ alpha: 1 }, 1000, Phaser.Easing.Sinusoidal.InOut).to({ alpha: 0 }, 1000, Phaser.Easing.Sinusoidal.InOut, false, 1000).start(); tween._lastChild.onComplete.add(this.onAnimationDone, this);I would like to know if it is the expected behavior or if there is a better way to do that ? Thank you. Link to comment Share on other sites More sharing options...
valueerror Posted September 22, 2014 Share Posted September 22, 2014 http://www.html5gamedevs.com/topic/9159-oncomplete-function-of-chained-tweens-triggers-after-the-first-tween-is-completed/ i had the same problem but i found that this is the best solution (last post) Link to comment Share on other sites More sharing options...
Recommended Posts