johncintron Posted December 25, 2016 Share Posted December 25, 2016 Phaser buttons don't have a built-in double-click handler so I created one because all of the other solutions I've seen are long and convoluted and hackily target the Input class rather than Button instances. var delay = 300; var button = game.add.button(x, y, key, function() { // code for first click let now = Date.now(); now - this.lastClick <= delay && this.onDoubleClick(); this.lastClick = now; }); button.lastClick = 0; button.onDoubleClick = function() { // code for double click } Thoughts? The_dude8080 1 Link to comment Share on other sites More sharing options...
Recommended Posts