Jump to content

Tweens


dthrasher90
 Share

Recommended Posts

2 hours ago, MikeW said:

use a call back in the tween to unset a flag that you set to say the tween is running.

Then check that in button code

Just some code to go with this:

var tween = this.add.tween(object).to({x:0},duration,Easing,autostart,delay);
tween.onStart.add(function() { button.inputEnabled = false; }, context);
tween.onComplete.add(function() { button.inputEnabled = true; }, context);

And take a look at disabling buttons here : Phaser Examples - Disable button

Link to comment
Share on other sites

59 minutes ago, Umz said:

Just some code to go with this:


var tween = this.add.tween(object).to({x:0},duration,Easing,autostart,delay);
tween.onStart.add(function() { button.inputEnabled = false; }, context);
tween.onComplete.add(function() { button.inputEnabled = true; }, context);

And take a look at disabling buttons here : Phaser Examples - Disable button

Aha an even better way

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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