Is there a Z layer on the UIElements?
Z Layer
-
- English
- yahwho
- Thread is Unresolved
-
-
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!