Handle z-index for gui loaded through collection proxy (SOLVED)

Hello,
I am new to Defold. I’m making a simple game and I use GitHub - britzl/monarch: Monarch is a Defold screen manager with transition support and a straight forward API to manage screens.
This is my main collection

There is a hud.gui in the game.collection to show question and score, and gameover.gui in gameover.collection to show some message.
I set game over screen to display as popup. When navigating to gameover screen, the nodes from hud.gui and gameover.gui mixed up.

This is my main game screen

And this is what it looks when showing gameover screen

!

I have tried to change the z-index of the gui and the collection proxy but neither of them work.

1 Like

Not entirely sure what the problem is here. Do you need to control render order of the gui scenes? If so: https://www.defold.com/ref/gui/#gui.set_render_order:order

3 Likes

After I set render order, it works as expected now.
Thank you. :star_struck:

2 Likes

Gui scenes and nodes completely ignore the z-value. You need gui.set_render_order() if you wish to control the render order of multiple gui components.

1 Like