[Question] Popup using Collection (SOLVED)

When I enable two different ‘collections’, I want to have the same effect as popups.

Collection_1

Collection_2

I want the screen

My situation.

As shown in the figure above, the node created in Collection_1 exists above Collection_2.
How do I make it the screen I want?

If you are (which I assume you are) creating your gui with gui_scenes you can control all gui rendering “layers” with gui.set_render_order .
I normally have the approach of having a small lua module that has constants like:
return {
BACKGROUND = 1
MAIN = 2
POPUP = 3
LOADER = 4
}

and then call it on all my gui_scenes like
gui.set_render_order(gui_order.POPUP)

2 Likes

I did not understand what gui_scenes were, but the information about gui.set_render_order was really beneficial. It is really good that my problem is resolved neatly in your words. Thank you.

By GUI Scene, Andreas probably means GUI templates? http://www.defold.com/manuals/gui-templates/

Ah sry for the confusion. I actually just meant a normal gui-component that you add into a gameobject. Don’t know why I thought they were called scenes.

1 Like

Just to be clear what the answer to the question is: The way you can control the render order of multiple gui components, be they in different collections or not, is via the gui.set_render_order() function.

1 Like