Hi.
I’m having a little trouble with UI widget ordering.
If I have created multiple widgets such as player and enemy health bars and maybe a pause menu, is there a way to specify which UI widget should be rendered on the top? Because if my pause menu contains buttons and if it gets rendered underneath the health bars, then I’m unable to interact with the buttons.
Thanks!
@Supremative
I think the Z ordering only applies to the elements inside a single widget. I want a sort of global ordering for multiple widgets
ZOrder in AddToViewport and AddToPlayerScreen sorts top-level widgets.
ZOrder in panels sorts children only.
In panels that don’t have ZOrder, widgets are sorted automatically by order.
2 Likes
Thank you so much!! I understood everything that you just said and I resolved my problem by providing a zorder to all the widgets I have added to the viewport.
For reference:-
if (WPauseMenu)
{
PauseMenu = CreateWidget(this, WPauseMenu);
if (PauseMenu)
{
PauseMenu->AddToViewport(10);
PauseMenu->SetVisibility(ESlateVisibility::Hidden);
}
}