How to move a widget in the hierarchy?

Hello!

It’s me again, I have another very basic issue with unreal UI : At runtime, how do I move widget in the hierarchy?
I have a inventory with item in it, so it’s basically a grid layout with thumnails of items. And I want the player to be able to select an item in the inventory, with the controller. So I need an image to be displayed on top of the item’s thumnail that is currently selected.

So I need my “selector” image to be displayed after all the items thumnails in my inventory. I don’t know how to do that, and I didn’t find anything relevant in google.

So if I have a hierarchy like that :

  • grid layout
    • Image A

And at runtime, I add an Image B on top of Image A (on the same grid slot), so Image A is hidden by Image B. So it becomes :

  • grid layout
    • Image A
    • Image B

What can I do to display Image A in front of Image B?

EDIT : I know that I could probably do some hack, like deleting Image A and recreating it, but I want to know if I can do something as basic as this without hack

Grid panel’s slots have Z order. The higher the value, the more on top that element is.

I don’t know how to modify Z order of a grid panel slot. It does not have acess to the SetZOrder function. Only the canvas slot as access to it :

But in this picture, my InventoryItemSelector is a grid slot, so I get a null ref when calling Slot as Canvas Slot. So I see no way of changing the z order

(ignore the value -10, I know it needs to be more than 0)

Hey, sorry about the confusion, it’s called layer for the Grid:

image

image

It’s been ages since I used it last.

This is perfect thank you, I should have seen that but for some reason it completely eluded my eyes

1 Like