- Home /
Place UI text on top of other elements in 2D
It appears that in the current UI system, the designer is not in full control of who are the tops and the bottoms. Currently the discussion that probably comes closest to this issue is this question from 2013 and it's very dissatisfying.
For some odd reason, UI elements do not have a sorting layer or sorting order, so most of the answers in that thread do not even apply (as those answers suggest using elements that have renderers, such as TextMesh).
Could it be that when the sorting layer functionality was introduced, UI has simply been forgotten?
Answer by domiii · Feb 09, 2016 at 05:50 AM
After researching a bit more, I found the answer:
In Unity 5, Canvas does have Sorting Layer and Sorting Order. So if you have UI elements, such as UI text or buttons, that you want to mix with non-UI elements, you can simply put each layer of UI elements into its own canvas and apply the sorting settings that you want to that canvas.
Note: Within a canvas, sorting options are simply determined by order of the hierarchy.
Note 2: If a canvas is a child of another canvas, it will hide that option and inherit from the root canvas, but you can simply tick the "Override Sorting" option and set your own.