I let Phaser create a DOM container, but the container blocks the pointer events for the game.
Hovering over game objects does not work.
Could someone help me?
I let Phaser create a DOM container, but the container blocks the pointer events for the game.
Hovering over game objects does not work.
Could someone help me?
Which Phaser version?
I’m using Phaser v3.54.0
I had the same problem while playing with this
Add in your css for that element pointer-events:all!important;
That will help you, also try to set DOM to be interactive.
Setting pointer-events
does not help.
That is what i did to solve the same problem, but again it depends on things that you have in your scene and dom.
Did you try to set interactive also?
new Phaser.Game({
callbacks: {
postBoot: function (game) {
game.domContainer.style.pointerEvents = 'none';
},
},
});
But you will need to set pointer-events: auto
on any HTML elements you want clickable.
Works perfectly, as I can see, pointer-events: none;
will already be set internally with the next update.
Thanks for the help!