Gui sorting order issues

Hey as far as I understand from documentation, the GUI nodes render based on their sorting order in the outline. Now the question is how do you change the sorting order in Editor 2.0. It seems that tutorial examples are from Editor 1.0 and in Editor 2.0 you can’t resort elements unless you start nesting them. Am I missing something? Dragging an element and dropping it in between two other elements seems to just choose one of the two as a nesting target. Is there any hotkey for ‘move-up’/‘move-down’?

I use hierarchies a lot for complex UIs, but what’s even more important to use both from an organizational perspective and for performance reasons is to use layers. Assign layers to your gui nodes to control render order and reduce draw calls. Check the gui manual for details.

You can use Alt-up and Alt-down to change the order.

For this and similar things, if you are in doubt, you can look in the Edit menu. It should have all the context-sensitive commands (and hotkeys) for whatever you are editing.

2 Likes

yeah I tried that, but I went over 16 and got layer cap errors

If you need more than 16 layers it’s likely that you have misunderstood their use. Have you read this post on draw calls, batching and guis: Draw calls and Defold

Yeah, I really don’t need more than 16 layers. I needed more than 16 UI elements neatly stacked on top of each other and sorted. I simply tried to use them as an alternative when I couldn’t reorder the hierarchy.

Ah, I understand. Well, @ross.grams provided a solution and you got it working right?

1 Like

Yes, I haven’t had a moment to sit down on that project, but it seems that’s what I wanted. Also thanks for the link to the article, I’ll have to do a thorough read on it.