CorayThan Posted September 28, 2018 Share Posted September 28, 2018 I have a bunch of buttons I'm using, and with some of them I destroy or disable them after they are clicked. They also use a hand cursor on hover. When I destroy them, the game seems to reset to the pointer just fine, but when I disable the input and turn off the hand cursor, it seems to get stuck on the hand cursor for the entire canvas. So basically, if I have a sprite with this.button.input.useHandCursor = true Then in the onClick I set that to false, the hand cursor doesn't go away. Does anyone know a way to manually change the cursor, or fix it so it changes properly by itself? I've tried document.getElementById("game").style.cursor = "auto" where "game" is the div I'm setting the phaser game in, but that doesn't change anything. Link to comment Share on other sites More sharing options...
samme Posted September 29, 2018 Share Posted September 29, 2018 You probably shouldn't set useHandCursor=false from within a button handler because then Phaser won't know to remove the hand cursor later. See https://samme.github.io/phaser-examples-mirror/buttons/disable button on click.html. The hand cursor disappears when the button is disabled. If you have to reset the cursor manually, it's game.canvas.style.cursor = ''; Link to comment Share on other sites More sharing options...
CorayThan Posted October 1, 2018 Author Share Posted October 1, 2018 Ah, that fixes it, thanks! That's curious though that you aren't setting handCursor=true at all and you're getting the hand cursor. That isn't working for me. Also thanks for the advice about resetting the cursor. With this working I won't need that for now, but maybe later. Link to comment Share on other sites More sharing options...
samme Posted October 1, 2018 Share Posted October 1, 2018 Buttons have useHandCursor=true by default, that's why it shows on https://samme.github.io/phaser-examples-mirror/buttons/disable button on click.html. fatboyarming 1 Link to comment Share on other sites More sharing options...
Recommended Posts