Is there a Z layer on the UIElements?
Z Layer
-
- English
- yahwho
- Thread is marked as Resolved.
A small new update is available now!
Unfortunately the forums, server list and report tool were offline last night due to technical issues. Sorry for the inconvenience! It should be working again.
However, unfortunately the Standalone update is temporarily not available. We expect it to be fixed in a couple of hours. Please let me know if you want to get a Steam key instead!
However, unfortunately the Standalone update is temporarily not available. We expect it to be fixed in a couple of hours. Please let me know if you want to get a Steam key instead!
-
-
Is there a Z layer on the UIElements?
i was also looking for this the other day, i could not find it. so if you cant and i cant i guess not lol
-
Well that's going to be a tough one to workaround

-
This is not fixed with the addChild order?
-
The problem is that I want to interlace with existing HUD elements, so I can't add them as a child to those. Maybe I could somehow grab them... 🤔
I could make a z-layer system myself...
Adding elements to a "render queue" and "set visible" each layer in order.
If that makes sense.
But then again, it may be a lot of graft with very little gain.
-
Unfortunately this isn't possible
UI Toolkit does not expose the z order and provides no way to change it. Even though Unity added this feature to their roadmap 3 years ago, it's still not available yet...Right now the Z order depends on the order when these elements were created (and parents are always drawn behind their childs). There is no workaround for that...
The problem is that I want to interlace with existing HUD elements, so I can't add them as a child to those. Maybe I could somehow grab them... 🤔
Does that mean you want to change the parent of a vanilla HUD element?
-
There is no workaround for that...

Does that mean you want to change the parent of a vanilla HUD element?
I was hoping to grab vanilla HUD elements and add children to them
-
I was hoping to grab vanilla HUD elements and add children to them
Oh, this is actually possible^^ But since this is a bit hacky (and may break with future updates), it's only possible through the Internals class. You could use the Internals.addUIElementToPlayer() method (instead of Player.addUIElement()) to add a UI element to an arbitrary target (this could be any UI element in the game).
It's a bit tricky to find the correct path of an element on HUD, but you could use the uidebugger console command to get the target path of a vanilla element

-
a bit hacky (and may break with future updates)
Hmm 🤔 I may have to rethink this one.... we'll see.
Thanks for the info though!
Participate now!
Don’t have an account yet? Create a new account now and be part of our community!