Hi [mention removed]
There isn’t a direct built-in function that disables all the Editor UI when running during PIE. For example, when pressing F11 to go full screen when playing PIE, what the editor does is hide all the UI and expand the viewport.
Ultimately, all Editor UI elements are Slate widgets layered on top of each other. Achieving the behavior you desire would require a custom implementation, but it can be done by creating an editor utility that enables or disables this feature when needed.
It’s also worth noting that Slate objects don’t tick the same way UObjects do. Some Slate widgets implement the Tick function and allow you to disable ticking, but this doesn’t apply to all of them. For example, SWidget allows you to disable ticking by calling SetCanTick().
Another option is to hide the Slate widgets, so they don’t render anything. I recommend hiding them rather than collapsing them, since collapsing will resize the viewport — and the engine might not be ready to handle that out of the box.
To get access to the main window, you can call:
TSharedPtr<SWindow> MainWin = FGlobalTabmanager::Get()->GetRootWindow();To get the Slate content of the main window, you can call:
TSharedPtr<SWidget> RootContent = MainWin->GetContent();If you want to get the child Slate widgets from a given widget, you can use
GetChildren:
FChildren* Children = Root->GetChildren();
In my test case, I used a recursive function to navigate and extract all the
SWidgets from the main window:
void CollectWidgetTree(const TSharedRef<SWidget>& Root, TArray<TSharedRef<SWidget>>& Out)
{
Out.Add(Root);
if (FChildren* Children = Root->GetChildren())
{
for (int32 i = 0; i < Children->Num(); ++i)
{
TSharedRef<SWidget> Child = Children->GetChildAt(i);
CollectWidgetTree(Child, Out);
}
}
}
Once you have access to all the SWidgets that build the main editor window, you can disable ticking if desired, or simply hide them so that they stop drawing. When PIE ends, or when the user leaves PIE focus, you can reverse this process to restore the UI.
Let me know if this information helps or if you have any further questions.
Best,
Joan