Hi guys,
I was playing around with DOM and depth in Phaser 3 and I’m not able to put an image over a DOM object. Looks like their have their own depth over the Game depth… any ideas on this?
Thanks for the quick answer!
I guess you are right because I read only setDepth method where is indicated “The depth of this Game Object within the Scene.” (probably copy-paste or reused) but is clear at the top of the doc saying Phaser will automatically create a DOM Container div that is positioned over the top of the game canvas
DOM elements are physically positioned over (or under) the game canvas itself. It’s not possible to cover them with another game object. Further down, the docs say:
It’s important to remember some limitations of DOM Elements: The obvious one is that they appear above or below your game canvas. You cannot blend them into the display list, meaning you cannot have a DOM Element, then a Sprite, then another DOM Element behind it.