Jump to content

[ASK][PHASER]Disable button after clicking to prevent double-click


Recommended Posts

You could add a custom property to the button. Do something like this: 

button = game.add.button(0,0, 'button', buttonPressed,this);button.clicked=false;function buttonPressed(){      if(!button.clicked}{       //do something       button.clicked=true;         game.time.events.add(1000,function(){ button.clicked=false},this);     } }
Link to comment
Share on other sites


  • Recently Browsing   0 members

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