Phaser buttons still clickable under other objects

In my Phaser 3 game I have few game buttons that are clickable/tappable but when I have to show a modal dialog/rectangle over the game, the buttons still show hand cursor and receive click events.

I can disable them manually before showing dialog or menu on top of them but is there a way to behave them like normal HTML 5 DOM where if a div is over a button it stop it from being clicked?

phaser-button

Interactive objects are blocked only by other interactive objects.

You can make an interactive Zone behind the modal, covering the game canvas.

1 Like