CraigH23 Posted April 7, 2017 Share Posted April 7, 2017 Hi, I have a button which calls a function: button = game.add.button(0, 0, 'button', function); when the button is clicked and the function is called I want to disable the button: button.input.enabled = false; if I print button.inputEnabled to the console, I get the expected value but the button is still clickable. I have also tried setting button.inputEnabled = false; but have the same issue. Thanks in advance, Craig. Link to comment Share on other sites More sharing options...
CraigH23 Posted April 7, 2017 Author Share Posted April 7, 2017 Solved it Link to comment Share on other sites More sharing options...
mcofko Posted September 26, 2018 Share Posted September 26, 2018 hi CraigH23, could you share your solution, cause I'm struggling with the same issue.... Link to comment Share on other sites More sharing options...
mcofko Posted September 26, 2018 Share Posted September 26, 2018 I figured out that I'm able to disable the input only if I set the property inputEnabled to FALSE inside the callback method. So for example let button: Phaser.Button = new Phaser.Button(this.game, this.game.world.centerX, this.game.world.height - 45,'key', null, this, 'frame1','frame2','frame3','frame4'); button.inputEnabled = false; button.onInputUp.add(this.onClick2); So in this case it will trigger the method onClick2 always. But then if I set inputEnabled=FALSE inside that method, then it actually disables the input. Is this normal behaviour? Link to comment Share on other sites More sharing options...
Recommended Posts