# Gui sorting order issues

**URL:** <https://forum.defold.com/t/gui-sorting-order-issues/18433>\
**Category:** Questions\
**Created:** [March 30, 2018, 2:52pm UTC](https://forum.defold.com/t/gui-sorting-order-issues/18433 "2018-03-30T14:52:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmalijonis](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jmalijonis/32/18870_2.png) [@jmalijonis](https://forum.defold.com/u/jmalijonis)\
**Post date:** [March 30, 2018, 2:52pm UTC](https://forum.defold.com/t/gui-sorting-order-issues/18433/1 "2018-03-30T14:52:44Z")

</div>

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’?

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [March 30, 2018, 3:02pm UTC](https://forum.defold.com/t/gui-sorting-order-issues/18433/2 "2018-03-30T15:02:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ross.grams](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/r/cab0a1/32.png) [@ross.grams](https://forum.defold.com/u/ross.grams)\
**Post date:** [March 30, 2018, 7:15pm UTC](https://forum.defold.com/t/gui-sorting-order-issues/18433/3 "2018-03-30T19:15:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jmalijonis](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jmalijonis/32/18870_2.png) [@jmalijonis](https://forum.defold.com/u/jmalijonis)\
**Post date:** [March 30, 2018, 9:59pm UTC](https://forum.defold.com/t/gui-sorting-order-issues/18433/4 "2018-03-30T21:59:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [March 31, 2018, 6:54am UTC](https://forum.defold.com/t/gui-sorting-order-issues/18433/5 "2018-03-31T06:54:32Z")

</div>

> [@jmalijonis](#):
>
> 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](https://forum.defold.com/t/draw-calls-and-defold/4674)

---

<div class="post-metadata">

**Author:** ![jmalijonis](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jmalijonis/32/18870_2.png) [@jmalijonis](https://forum.defold.com/u/jmalijonis)\
**Post date:** [April 1, 2018, 7:15pm UTC](https://forum.defold.com/t/gui-sorting-order-issues/18433/6 "2018-04-01T19:15:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [April 1, 2018, 7:51pm UTC](https://forum.defold.com/t/gui-sorting-order-issues/18433/7 "2018-04-01T19:51:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jmalijonis](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jmalijonis/32/18870_2.png) [@jmalijonis](https://forum.defold.com/u/jmalijonis)\
**Post date:** [April 3, 2018, 9:31am UTC](https://forum.defold.com/t/gui-sorting-order-issues/18433/8 "2018-04-03T09:31:36Z")

</div>

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.
