feat(ui): add RenderOrder property for UI component stacking#3104
feat(ui): add RenderOrder property for UI component stacking#3104laske185 wants to merge 1 commit intostride3d:masterfrom
Conversation
- Introduce RenderOrder property to UIComponent for custom render order. - Propagate RenderOrder through RenderUIElement and UIRenderProcessor. - Sort UI elements by RenderOrder in UIRenderFeature to control stacking. - Allows developers to specify which UI components appear in front or behind others.
|
I have not tested your changes yet, but on Discord I was talking about this recently. While you are at this, can you check what effect it has in ordering the Btw, in |
|
I also played with the parameters inside the UIPage, like depth, draw layer number, and alignment of the container components. Additionally, I tested the position and the z-coordinate of resolution and size. But all did not work. In my scenario, I have a split-screen setup with its own UIComponent for the render-to-texture images and a UI for the HUD. It is not deterministic whether the hub is before or behind the split-screen UI. I started to combine the complete UI into one UIPage to be able to set the depth, but now I have a huge UI monolith. With the solution from this PR, the render pipeline is manipulated to order the UI pages. This explains to me why all parameters did not have any effect on the draw order, because the pipeline renders component for component and overwrites the previous paint. |
To get a quick answer, I asked Claude, and it confirmed what I had observed:
In short: |
PR Details
Add
RenderOrderproperty toUIComponentto control draw order of overlapping UI components. Lower values are rendered first (behind), higher values render on top. Default is0, preserving existing behavior.Related Issue
None.
Types of changes
Checklist