UDreamUserWidget
A widget hierarchy that is a CLASS rather than an asset instance -- the counterpart to UMG's
Inherits from UDreamWidget.
Declared in Public/Core/DreamUserWidget.h.
A widget hierarchy that is a CLASS rather than an asset instance -- the counterpart to UMG's UUserWidget, and the thing a DreamUI prefab is becoming.
It is itself a UDreamWidget, exactly as UUserWidget is a UWidget. That is what makes nesting fall out for free: one of these placed inside another hierarchy is just a widget in that hierarchy, while its own contents come from its own class.
Its contents live behind WidgetTree rather than directly in Children, and that indirection is not decoration. Without it "the class of one widget" and "the class of a hierarchy" would be the same thing, and a UDreamWidget subclass (they are Blueprintable) could not be told apart from a hierarchy template. UMG buys the same separation with UWidgetTree, and it is not optional here either.
WidgetTree is Transient: a class template must never carry an expanded subtree, or a nested user widget would be baked into its parent's template and stop tracking its own class. It is built at Initialize, from the class, every time.
Properties
| Name | Type | Category | In the details panel | From Blueprint | Description |
|---|---|---|---|---|---|
bWantsTick | bool | DreamGUI | UserWidget | yes | read only |
bAllowEventBubbleUp | bool | DreamGUI | UserWidget | yes | read only |
bCanNavigateHere | bool | DreamGUI | UserWidget | yes | read only |
Functions
| Function | Kind | Description |
|---|---|---|
void BindToAnimationEvent(UMovieSceneSequence* Animation, FDreamUIAnimationDynamicEvent Delegate, EDreamUIAnimationEvent AnimationEvent) | callable | The general form of the two above. |
void BindToAnimationFinished(UMovieSceneSequence* Animation, FDreamUIAnimationDynamicEvent Delegate) | callable | Called when an instance of the animation ends, naturally or by Stop. Unbind with the same delegate. |
void BindToAnimationStarted(UMovieSceneSequence* Animation, FDreamUIAnimationDynamicEvent Delegate) | callable | Called when an instance of the animation starts. Unbind with the same delegate. |
void ClearPlacementInViewport() | callable | Hand the page's geometry back to the stack, which means full-bleed again from the next refresh. |
void EvaluatePropertyBindings() | callable | Run ALL of this widget's property bindings once: call each bound function, hand the result to the widget's setter. Runs at Initialize (so the first frame shows bound values), and is safe to call by hand. |
UDreamWidgetAnimationComponent* FindAnimationComponentFor(UMovieSceneSequence* InAnimation) | pure | The component holding InAnimation, or null. Exposed because a caller that wants the parts of the component API this widget does not mirror should not have to guess which widget carries it. |
FDreamUIAnimationHandle FindAnimationInstance(UMovieSceneSequence* Animation) | pure | The newest live (playing or paused) instance of an animation, or an invalid handle. |
UDreamWidget* FindSlotWidget(FName InSlotName) | pure | The widget carrying the UDreamNamedSlot of that name inside this instance, or null. |
void FlushAnimations() | callable | Applies any evaluation still queued for this widget's animations before returning. |
bool GetAllowEventBubbleUp() | pure | Get Allow Event Bubble Up |
UMovieSceneSequence* GetAnimationByName(FString Name) | pure | The animation of this widget's hierarchy with that display name, or null. The counterpart of PlayAnimationByName for callers that want the animation OBJECT -- to bind an event to it, to ask whether it is playing, to hand it to a handle-taking call -- rather than to play it. Names an embedded animation by its display name and a standalone sequence asset by its asset name, exactly as PlayAnimationByName does. |
float GetAnimationCurrentTime(FDreamUIAnimationHandle Handle) | pure | Seconds into the animation; zero for a handle that is no longer live. |
bool GetCanNavigateHere() | pure | Get Can Navigate Here |
UDreamWidget* GetContentForNamedSlot(FName InSlotName) | pure | What the host put in InSlotName, or null. Reads the binding, not the attachment. |
UDreamWidget* GetContentRoot() | pure | The root of this widget's own contents -- the tree's root, not this widget. Null before Initialize. |
FName GetDefaultSlotName() | pure | The slot that content arriving WITHOUT a slot name goes to -- .dui nesting, and a designer drop onto the control itself. None means unslotted content stays where it landed. |
FVector2D GetLocalSize() | pure | This widget's own box, in its own space -- the local half of UMG's GetCachedGeometry. |
TArray<FName> GetNativeSlotNames() | pure | The holes this CLASS opens, for a class whose contents are code rather than an archetype. |
APawn* GetOwningPlayerPawn() | pure | Get Owning Player Pawn |
FBox2D GetScreenSpaceRect() | pure | Where this widget lands on the screen, in the root canvas's space -- the absolute half of UMG's GetCachedGeometry / GetPaintSpaceGeometry. Zero-sized when the widget is not under a canvas. |
bool GetWantsTick() | pure | Get Wants Tick |
UDreamWidget* GetWidgetFromName(FName InVariableName) | pure | The widget of that variable name inside this instance -- UMG's GetWidgetFromName. |
UDreamWidgetTree* GetWidgetTree() | pure | Get Widget Tree |
bool HasPlayingAnimation(UMovieSceneSequence* Animation) | pure | True if any instance of the animation is currently playing. |
bool IsAnimationPaused(FDreamUIAnimationHandle Handle) | pure | Is Animation Paused |
bool IsAnimationPlaying(FDreamUIAnimationHandle Handle) | pure | Is Animation Playing |
bool IsAnimationPlayingForward(FDreamUIAnimationHandle Handle) | pure | True while the instance runs towards its end; false when reversed. |
bool IsAnyAnimationPlaying() | pure | True if any animation on any component of this widget's own contents is playing. |
bool IsConstructed() | pure | True between NativeOnConstruct and NativeOnDestruct -- the widget is live on screen. |
bool IsDesignTime() | pure | True in the designer's preview, false in PIE and in a cooked game -- UMG's IsDesignTime. |
bool IsInitialized() | pure | Is Initialized |
bool IsListeningForInputAction(FDreamUIActionHandle InHandle) | pure | Is Listening for Input Action |
void K2_AddFieldValueChangedDelegate(FFieldNotificationId FieldId, FFieldValueChangedDynamicDelegate Delegate) | callable | Add Field Value Changed Delegate |
void K2_BroadcastFieldValueChanged(FFieldNotificationId FieldId) | callable | Tell everyone listening that a field changed -- UMG's K2_BroadcastFieldValueChanged. |
TArray<FName> K2_GetDeclaredSlotNames() | pure | The named slots this instance declares, in the order its class declares them. |
void K2_RemoveFieldValueChangedDelegate(FFieldNotificationId FieldId, FFieldValueChangedDynamicDelegate Delegate) | callable | Remove Field Value Changed Delegate |
FDreamUIActionHandle ListenForInputAction(FDataTableRowHandle InAction, FDreamUIActionExecutedDelegate InCallback, bool bDisplayInActionBar) | callable | UMG's ListenForInputAction, on this framework's own action layer. |
void OnAnimationFinished(UMovieSceneSequence* Animation) | event | An instance of one of this widget's animations ended, naturally or by Stop. |
void OnAnimationStarted(UMovieSceneSequence* Animation) | event | An instance of one of this widget's animations started. |
void OnBeginDrag(UDreamPointerEventData* EventData) | event | On Begin Drag |
void OnConstruct() | event | The Blueprint half of NativeOnConstruct, called by it. |
void OnDestruct() | event | The Blueprint half of NativeOnDestruct, called by it. |
void OnDisable() | event | The Blueprint half of NativeOnDisable, called by it. |
void OnDoubleClick(UDreamPointerEventData* EventData) | event | On Double Click |
void OnDrag(UDreamPointerEventData* EventData) | event | On Drag |
void OnDragCancelled(UDreamDragDropOperation* Operation) | event | On Drag Cancelled |
void OnDragEnter(UDreamPointerEventData* EventData, UDreamDragDropOperation* Operation) | event | On Drag Enter |
void OnDragLeave(UDreamPointerEventData* EventData, UDreamDragDropOperation* Operation) | event | On Drag Leave |
void OnDragOver(UDreamPointerEventData* EventData, UDreamDragDropOperation* Operation) | event | On Drag Over |
void OnDrop(UDreamPointerEventData* EventData) | event | On Drop |
void OnEnable() | event | The Blueprint half of NativeOnEnable, called by it. |
void OnEndDrag(UDreamPointerEventData* EventData) | event | On End Drag |
void OnInitialized() | event | The Blueprint half of NativeOnInitialized, called by it. Same contract, same moment. |
void OnLongPress(UDreamPointerEventData* EventData) | event | On Long Press |
void OnMouseMove(UDreamPointerEventData* EventData) | event | On Mouse Move |
void OnMouseWheel(UDreamPointerEventData* EventData) | event | On Mouse Wheel |
UDreamWidget* OnNavigate(EDreamUINavigationDirection Direction) | event | The Blueprint half of NativeOnNavigate: return the widget to move to, or nothing to stay. |
void OnPinch(UDreamGestureEventData* EventData) | event | On Pinch |
void OnPointerClick(UDreamPointerEventData* EventData) | event | On Pointer Click |
void OnPointerDown(UDreamPointerEventData* EventData) | event | On Pointer Down |
void OnPointerEnter(UDreamPointerEventData* EventData) | event | On Pointer Enter |
void OnPointerExit(UDreamPointerEventData* EventData) | event | On Pointer Exit |
void OnPointerUp(UDreamPointerEventData* EventData) | event | On Pointer Up |
void OnSlotContentAttached() | event | The Blueprint half of NativeOnSlotContentAttached: the host's content is in place. |
void OnSwipe(UDreamGestureEventData* EventData) | event | On Swipe |
void OnTick(float DeltaTime) | event | The Blueprint half of NativeOnTick, called by it while ticking is opted in. |
float PauseAnimation(FDreamUIAnimationHandle Handle) | callable | @return the time the instance was at when paused, in seconds; feed it back to PlayAnimation's StartAtTime to resume from there. |
float PauseAnimationsOf(UMovieSceneSequence* Animation) | callable | Pauses every live instance of the animation. @return the paused time of the newest one, in seconds. |
FDreamUIAnimationHandle PlayAnimation(UMovieSceneSequence* Animation, float StartAtTime, int32 NumLoopsToPlay, EDreamUIAnimationPlayMode PlayMode, float PlaybackSpeed, bool bRestoreState) | callable | Plays one of this widget's animations. The entry the compiler's generated animation variables feed: drag the variable in, drop it on Animation, leave Target as self. |
FDreamUIAnimationHandle PlayAnimationByName(FString Name, float StartAtTime, int32 NumLoopsToPlay, EDreamUIAnimationPlayMode PlayMode, float PlaybackSpeed, bool bRestoreState) | callable | By display name, for callers that genuinely start from text. Prefer the animation variable. |
FDreamUIAnimationHandle PlayAnimationForward(UMovieSceneSequence* Animation, float PlaybackSpeed, bool bRestoreState) | callable | Plays an animation forward relative to its current state: an instance already running or paused turns around from where it is, otherwise a new one starts from the beginning. The "panel slides out on click, slides back on the next click" idiom, exactly as in UMG. |
FDreamUIAnimationHandle PlayAnimationReverse(UMovieSceneSequence* Animation, float PlaybackSpeed, bool bRestoreState) | callable | The reverse half of PlayAnimationForward: turns a live instance around, or starts one from the end. |
FDreamUIAnimationHandle PlayAnimationTimeRange(UMovieSceneSequence* Animation, float StartAtTime, float EndAtTime, int32 NumLoopsToPlay, EDreamUIAnimationPlayMode PlayMode, float PlaybackSpeed, bool bRestoreState) | callable | Plays an animation and stops it at EndAtTime rather than at its end. @param EndAtTime Absolute seconds into the animation where playback ends. Zero or less means the animation's own end. |
void PlaySound(USoundBase* InSound, float InVolumeMultiplier, float InPitchMultiplier) | callable | UMG's PlaySound: a 2D sound for the owning player, with no attenuation and no world position. |
void PreConstruct(bool bIsDesignTime) | event | UMG's PreConstruct, with the flag it is named for. |
void QueuePauseAnimation(FDreamUIAnimationHandle Handle) | callable | Queue Pause Animation |
void QueuePlayAnimation(UMovieSceneSequence* Animation, float StartAtTime, int32 NumLoopsToPlay, EDreamUIAnimationPlayMode PlayMode, float PlaybackSpeed, bool bRestoreState) | callable | The same operations deferred to the end of this frame's sequence evaluation: safe from inside an animation's own Started / Finished / event callbacks. |
void QueuePlayAnimationTimeRange(UMovieSceneSequence* Animation, float StartAtTime, float EndAtTime, int32 NumLoopsToPlay, EDreamUIAnimationPlayMode PlayMode, float PlaybackSpeed, bool bRestoreState) | callable | Queue Play Animation Time Range |
void QueueStopAllAnimations() | callable | Queue Stop All Animations |
void QueueStopAnimation(FDreamUIAnimationHandle Handle) | callable | Queue Stop Animation |
bool ReceiveAnalogValueChanged(UDreamKeyEventData* EventData) | event | On Analog Value Changed |
void ReceiveFocusLost(int32 UserIndex, int32 PointerId) | event | On Focus Lost |
void ReceiveFocusReceived(int32 UserIndex, int32 PointerId) | event | On Focus Received |
bool ReceiveKeyChar(UDreamKeyEventData* EventData) | event | On Key Char |
bool ReceiveKeyDown(UDreamKeyEventData* EventData) | event | On Key Down |
bool ReceiveKeyUp(UDreamKeyEventData* EventData) | event | On Key Up |
void RefreshEachBindings() | callable | Re-read every each and for source and refresh its list or its copies. A source that is a FieldNotify variable calls this for you when it broadcasts; a function source has nothing to broadcast, so code that changed what it returns calls this by hand. |
void ResumeAnimation(FDreamUIAnimationHandle Handle) | callable | Continues a paused instance in the direction it was going. |
void ReverseAnimation(FDreamUIAnimationHandle Handle) | callable | Reverse Animation |
void SetAlignmentInViewport(FVector2D InAlignment) | callable | Pivot, in 0..1 of this widget's own box. UMG calls it alignment. |
void SetAllowEventBubbleUp(bool Value) | callable | Whether pointer/drag events keep bubbling to ancestors after this widget has seen them. |
void SetAnchorsInViewport(FVector2D InAnchorMin, FVector2D InAnchorMax) | callable | Anchors against the screen, min and max in 0..1. Both equal is a point anchor. |
void SetAnimationCurrentTime(FDreamUIAnimationHandle Handle, float InTime) | callable | Jumps the instance to a time in seconds without changing whether it is playing. |
void SetCanNavigateHere(bool Value) | callable | Opt this widget in as a gamepad/keyboard navigation stop. Off, navigation ignores it entirely. |
bool SetContentForNamedSlot(FName InSlotName, UDreamWidget* InContent) | callable | Bind InContent to InSlotName. InContent must belong to the same tree as this widget -- a slot is filled by the host that placed this instance, never by a third asset. |
void SetDesiredSizeInViewport(FVector2D InSize) | callable | Set Desired Size in Viewport |
void SetNumLoopsToPlay(FDreamUIAnimationHandle Handle, int32 NumLoopsToPlay) | callable | Changes how many times a live instance plays in total. Zero loops indefinitely. |
void SetOwningPlayer(APlayerController* InPlayerController) | callable | Point this widget (and everything it goes on to create) at a different local player. |
void SetPlaybackSpeed(FDreamUIAnimationHandle Handle, float PlaybackSpeed) | callable | Set Playback Speed |
void SetPositionInViewport(FVector2D InPosition) | callable | UMG's SetPositionInViewport, and the three that go with it. |
void SetWantsTick(bool Value) | callable | Opt this widget in or out of per-frame OnTick. Safe at any time, including from OnInitialized. |
void StopAllAnimations() | callable | Every animation on every component of this widget's own contents, nested instances excluded. |
void StopAnimation(FDreamUIAnimationHandle Handle) | callable | Ends the instance where it is. Its Finished delegates fire, the same as a natural end. |
void StopAnimationsOf(UMovieSceneSequence* Animation) | callable | Stops every live instance of the animation. |
void StopListeningForAllInputActions() | callable | Stop Listening for All Input Actions |
void StopListeningForInputAction(FDreamUIActionHandle InHandle) | callable | Stop Listening for Input Action |
void UnbindAllFromAnimationFinished(UMovieSceneSequence* Animation) | callable | Unbind All from Animation Finished |
void UnbindAllFromAnimationStarted(UMovieSceneSequence* Animation) | callable | Unbind All from Animation Started |
void UnbindFromAnimationFinished(UMovieSceneSequence* Animation, FDreamUIAnimationDynamicEvent Delegate) | callable | Unbind from Animation Finished |
void UnbindFromAnimationStarted(UMovieSceneSequence* Animation, FDreamUIAnimationDynamicEvent Delegate) | callable | Unbind from Animation Started |
Events
| Event | Signature | Description |
|---|---|---|
OnAnimationEvent | void DreamUIAnimEventDelegate__DelegateSignature(FName EventName) | A DreamUI Event track key crossed while one of this widget's animations plays. |