How to disable Phaser.Button?

I am unable to make Phaser.Button disabled i.e put in a state of not being clickable (disabled visual state) and also disable processing events, i.e even if you set inputEnabled = false, the hand cursor doesn’t show but the button still processes the click handler.

Is there some simple way to disable Phaser.Button or I would need to go and remove step by step all event handlers and then add them back when the button gets enabled.


button.input.enabled = false


button.inputEnabled = false

should do that.

Hmm, yes

inputEnabled = false

does work, however, if tween is applied like I do, to fade in all object on one screen so it looks like smooth transition, it seems it doesn’t apply it in some case. As if the input is re-enabled if I set inputEnabled = false before calling the tween.
But if I set inputEnabled = false after calling the tween, the button will be disabled.