How would I render a UI object above another? (SOLVED)

(I’m new to defold and couldn’t figure this out by myself)

How would I render the white frame over the blue one?
image

Easiest way, assuming they are in the same GUI object, is to ensure that the white box is lower on the Outline list than the blue box. You can re-arrange nodes by selecting them and using Alt+(up or down).

Another way is to use layers: GUI scenes in Defold

Finally, if the elements reside in different GUI objects altogether then you are looking for render order, which you set in a script: API reference (gui)

6 Likes

Gui nodes act a bit different than GO’s. Gui draw order does not depend on z-order. The draw order depends on where it sits in the hierarchical list in the editor you can select the node in the editor then press alt + up/down to move the node in the hierarchy list.

You can find more info here :

There is also layers which are very handy.

5 Likes

Thanks, that was the solution! Didn’t know its that easy.

5 Likes