Ordering overlapping GUI elements

Hello,
I assume that zIndex specifies order in which GUI elements are appearing. In the example, below I draw a wood image with index 2, a brick image with index 1, and a button with index 3. Assuming the increasing order, the brick image should be covered by the wood image, but that is not the case at least on my devices

Please let me know how I can specify the order for overlaping UI elements
thank you

Nah. That’s not quite the way it is. You are using GUI in FS mode. And you are using two ADTs in full-screen (which is already something you shouldn’t do). In full-screen mode, the ADT is a layer that is drawn on top of everything (except for the 3D GUI). So your ordering of controls does not make for the ordering of the ADT layers hosting them. I would stick to the conventional method of using a single FS ADT. You can order things from the hierarchy and you can create containers for each. The GUI Editor is a nice tool to sketch complex layouts for an FS ADT. If you cannot achieve it all through just a single FS ADT, consider adding an ADT for mesh and work it from the camera(s), eventually using layerMask for ordering the layers of GUI when seen from n camera.
I hope this helps and meanwhile, have a great day :sunglasses:

Edit: forgot to mention that (as per the title of your post) there is a method for ordering overlapping elements/controls… but then, within a single ADT/ADT layer.

2 Likes

Another point of note is that zIndex only works for controls that are on the same hierarchic level, i.e, if you have a parent and a child control, the child will always be on top of the parent, no matter their respective z indexes :slight_smile:

3 Likes

@mawa and @carolhmj Thank you for pointing out the usage of zIndex.
And yes, once I removed the second ADT, it started to work as expected

1 Like