-
So following my last questions, where I tried to unsuccessfully apply rotation transforms to elements inside a ui menu (I almost got it to work by putting the rotated ImageBundle centered in a container, but then the cropping had some really weird behavior), I instead changed strategy and tried to play with the zindex and position of independent ui elements and sprite elements. However, what I'm noticing now is that the ui element always appear on top of my sprite. In the ui element, I tried setting the zindex to low local or global values. In the sprite element, I tried putting the third parameter in the transition for the transform (as I understand it, the zindex for 2D) to different values including 1000000.0 and no matter what, the ui element is always on top. Is that a deliberate decision? Or am doing something wrong and controlling the relative zindices of ui and non-ui component is an easily solvable problem? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Yes, UI is drawn in a separate pass on top of other cameras. Messing with It looks like you're doing a minimap? I would consider using a separate 2d camera, rendering it to a texture, and then displaying that texture in your UI with an |
Beta Was this translation helpful? Give feedback.
Yes, UI is drawn in a separate pass on top of other cameras. Messing with
Transform
of UI components is a sort of undefined behavior, and we don't have a way of doing arbitrary rotations of UI nodes.It looks like you're doing a minimap? I would consider using a separate 2d camera, rendering it to a texture, and then displaying that texture in your UI with an
ImageBundle
. https://bevyengine.org/examples/3d-rendering/render-to-texture/ should get you most of the way there.