how can I render text(city names) always top of box(city icons)? I think defold does not have z_index in gui so I changed text z position however it didnt change anything maybe because of text(city names) are child of box(city icon) ?
GUI render nodes in the order they appear in the node tree (learn more here: Draw calls and Defold).
You can use layers to separate your text nodes. To do this, you should:
- Add a layer called “text” in your GUI layers.
- Assign the “text” layer to all your text nodes.
If a text node is placed inside a GUI template and you adjust layers inside that template, you must also add the same layers to all GUIs that use this template.
thanks it worked.
but I didnt understand your last sentence, can you elaborate on that? ”If a text node is placed inside a GUI template and you adjust layers inside that template, you must also add the same layers to all GUIs that use this template.”
It means that GUI files can contain other GUIs (templates). And if this template use layers the parent GUI file also should use these layers
Anyway it will throw error in the console, don’t worry