DreamGUI
Reference

UDreamNativeWidgetHost

A hole in a DreamGUI hierarchy that a UMG widget fills.

Inherits from UDreamUIControl.

Declared in Public/Controls/DreamNativeWidgetHost.h.

A hole in a DreamGUI hierarchy that a UMG widget fills.

UMG's NativeWidgetHost is the reverse bridge -- a UMG widget wrapping a raw Slate one -- and this is the same idea pointed the other way, which is the direction that matters here: the DreamGUI tree is the outer one, and what a project needs is a way to keep a UMG screen it already owns (an engine widget, a plugin's panel, a Slate-only editor surface) inside it.

The machinery already existed and had no control: UDreamUMGWidget renders a UUserWidget (or a bare SWidget) to a render target and draws it as this library's own geometry, and UDreamUMGWidgetInteraction routes pointer events into it. Both are components an author had to know to add, wire and size. This class is the one tag that does it.

WHAT IT IS NOT: a way to mix UMG layout with DreamGUI layout. The hosted widget is drawn into a texture at this control's size and knows nothing about what is around it -- it cannot push the DreamGUI layout around and DreamGUI cannot reach inside it. That is the bargain the render-target bridge makes, it is the same one UMG's own world-space widget component makes, and a control that pretended otherwise would be lying about which layout pass owns what.

NEEDS A WORLD, like everything that instances a UserWidget: with none (a headless test, the parts of the designer that build no world) the host node exists, sized and placed, and simply draws nothing. That is the same answer UDreamListViewBase gives for a row template class.

Properties

NameTypeCategoryIn the details panelFrom BlueprintDescription
WidgetClassTSubclassOf<UUserWidget>Native Widget HostyesGetWidgetClass / SetWidgetClassThe UMG widget class to instance and draw. Null draws nothing, which is an empty hole.
ResolutionScalefloatNative Widget HostyesSetResolutionScaleHow many render-target pixels one local unit is worth. One is pixel-for-pixel.
BackgroundColorFLinearColorNative Widget HostyesSetBackgroundColorWhat shows through where the hosted widget draws nothing. Transparent by default.
HostNodeTObjectPtr<UDreamWidget>Native Widget Host-read onlyThe node whose visual is the bridge. Public because everything under a control is reachable.
HostVisualTObjectPtr<UDreamUMGWidget>Native Widget Host-read onlyThe bridge itself, for everything this control does not wrap.

Functions

FunctionKindDescription
UUserWidget* GetHostedWidget()pureThe instance the bridge made, or null while there is no world or no class.
TSubclassOf<UUserWidget> GetWidgetClass()pureGet Widget Class
void SetBackgroundColor(FLinearColor InBackgroundColor)callableWhat the render target is cleared to behind the hosted widget. Pushed to the host visual at once.
void SetResolutionScale(float InResolutionScale)callableRender-target pixels per local unit of the host. Pushed to the host visual at once.
void SetWidgetClass(TSubclassOf<UUserWidget> InWidgetClass)callableReplace the hosted class and re-instance it. Null empties the hole.

On this page