DreamGUI
Reference

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

NameTypeCategoryIn the details panelFrom BlueprintDescription
bWantsTickboolDreamGUIUserWidgetyesread only
bAllowEventBubbleUpboolDreamGUIUserWidgetyesread only
bCanNavigateHereboolDreamGUIUserWidgetyesread only

Functions

FunctionKindDescription
void BindToAnimationEvent(UMovieSceneSequence* Animation, FDreamUIAnimationDynamicEvent Delegate, EDreamUIAnimationEvent AnimationEvent)callableThe general form of the two above.
void BindToAnimationFinished(UMovieSceneSequence* Animation, FDreamUIAnimationDynamicEvent Delegate)callableCalled when an instance of the animation ends, naturally or by Stop. Unbind with the same delegate.
void BindToAnimationStarted(UMovieSceneSequence* Animation, FDreamUIAnimationDynamicEvent Delegate)callableCalled when an instance of the animation starts. Unbind with the same delegate.
void ClearPlacementInViewport()callableHand the page's geometry back to the stack, which means full-bleed again from the next refresh.
void EvaluatePropertyBindings()callableRun 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)pureThe 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)pureThe newest live (playing or paused) instance of an animation, or an invalid handle.
UDreamWidget* FindSlotWidget(FName InSlotName)pureThe widget carrying the UDreamNamedSlot of that name inside this instance, or null.
void FlushAnimations()callableApplies any evaluation still queued for this widget's animations before returning.
bool GetAllowEventBubbleUp()pureGet Allow Event Bubble Up
UMovieSceneSequence* GetAnimationByName(FString Name)pureThe 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)pureSeconds into the animation; zero for a handle that is no longer live.
bool GetCanNavigateHere()pureGet Can Navigate Here
UDreamWidget* GetContentForNamedSlot(FName InSlotName)pureWhat the host put in InSlotName, or null. Reads the binding, not the attachment.
UDreamWidget* GetContentRoot()pureThe root of this widget's own contents -- the tree's root, not this widget. Null before Initialize.
FName GetDefaultSlotName()pureThe 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()pureThis widget's own box, in its own space -- the local half of UMG's GetCachedGeometry.
TArray<FName> GetNativeSlotNames()pureThe holes this CLASS opens, for a class whose contents are code rather than an archetype.
APawn* GetOwningPlayerPawn()pureGet Owning Player Pawn
FBox2D GetScreenSpaceRect()pureWhere 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()pureGet Wants Tick
UDreamWidget* GetWidgetFromName(FName InVariableName)pureThe widget of that variable name inside this instance -- UMG's GetWidgetFromName.
UDreamWidgetTree* GetWidgetTree()pureGet Widget Tree
bool HasPlayingAnimation(UMovieSceneSequence* Animation)pureTrue if any instance of the animation is currently playing.
bool IsAnimationPaused(FDreamUIAnimationHandle Handle)pureIs Animation Paused
bool IsAnimationPlaying(FDreamUIAnimationHandle Handle)pureIs Animation Playing
bool IsAnimationPlayingForward(FDreamUIAnimationHandle Handle)pureTrue while the instance runs towards its end; false when reversed.
bool IsAnyAnimationPlaying()pureTrue if any animation on any component of this widget's own contents is playing.
bool IsConstructed()pureTrue between NativeOnConstruct and NativeOnDestruct -- the widget is live on screen.
bool IsDesignTime()pureTrue in the designer's preview, false in PIE and in a cooked game -- UMG's IsDesignTime.
bool IsInitialized()pureIs Initialized
bool IsListeningForInputAction(FDreamUIActionHandle InHandle)pureIs Listening for Input Action
void K2_AddFieldValueChangedDelegate(FFieldNotificationId FieldId, FFieldValueChangedDynamicDelegate Delegate)callableAdd Field Value Changed Delegate
void K2_BroadcastFieldValueChanged(FFieldNotificationId FieldId)callableTell everyone listening that a field changed -- UMG's K2_BroadcastFieldValueChanged.
TArray<FName> K2_GetDeclaredSlotNames()pureThe named slots this instance declares, in the order its class declares them.
void K2_RemoveFieldValueChangedDelegate(FFieldNotificationId FieldId, FFieldValueChangedDynamicDelegate Delegate)callableRemove Field Value Changed Delegate
FDreamUIActionHandle ListenForInputAction(FDataTableRowHandle InAction, FDreamUIActionExecutedDelegate InCallback, bool bDisplayInActionBar)callableUMG's ListenForInputAction, on this framework's own action layer.
void OnAnimationFinished(UMovieSceneSequence* Animation)eventAn instance of one of this widget's animations ended, naturally or by Stop.
void OnAnimationStarted(UMovieSceneSequence* Animation)eventAn instance of one of this widget's animations started.
void OnBeginDrag(UDreamPointerEventData* EventData)eventOn Begin Drag
void OnConstruct()eventThe Blueprint half of NativeOnConstruct, called by it.
void OnDestruct()eventThe Blueprint half of NativeOnDestruct, called by it.
void OnDisable()eventThe Blueprint half of NativeOnDisable, called by it.
void OnDoubleClick(UDreamPointerEventData* EventData)eventOn Double Click
void OnDrag(UDreamPointerEventData* EventData)eventOn Drag
void OnDragCancelled(UDreamDragDropOperation* Operation)eventOn Drag Cancelled
void OnDragEnter(UDreamPointerEventData* EventData, UDreamDragDropOperation* Operation)eventOn Drag Enter
void OnDragLeave(UDreamPointerEventData* EventData, UDreamDragDropOperation* Operation)eventOn Drag Leave
void OnDragOver(UDreamPointerEventData* EventData, UDreamDragDropOperation* Operation)eventOn Drag Over
void OnDrop(UDreamPointerEventData* EventData)eventOn Drop
void OnEnable()eventThe Blueprint half of NativeOnEnable, called by it.
void OnEndDrag(UDreamPointerEventData* EventData)eventOn End Drag
void OnInitialized()eventThe Blueprint half of NativeOnInitialized, called by it. Same contract, same moment.
void OnLongPress(UDreamPointerEventData* EventData)eventOn Long Press
void OnMouseMove(UDreamPointerEventData* EventData)eventOn Mouse Move
void OnMouseWheel(UDreamPointerEventData* EventData)eventOn Mouse Wheel
UDreamWidget* OnNavigate(EDreamUINavigationDirection Direction)eventThe Blueprint half of NativeOnNavigate: return the widget to move to, or nothing to stay.
void OnPinch(UDreamGestureEventData* EventData)eventOn Pinch
void OnPointerClick(UDreamPointerEventData* EventData)eventOn Pointer Click
void OnPointerDown(UDreamPointerEventData* EventData)eventOn Pointer Down
void OnPointerEnter(UDreamPointerEventData* EventData)eventOn Pointer Enter
void OnPointerExit(UDreamPointerEventData* EventData)eventOn Pointer Exit
void OnPointerUp(UDreamPointerEventData* EventData)eventOn Pointer Up
void OnSlotContentAttached()eventThe Blueprint half of NativeOnSlotContentAttached: the host's content is in place.
void OnSwipe(UDreamGestureEventData* EventData)eventOn Swipe
void OnTick(float DeltaTime)eventThe 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)callablePauses 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)callablePlays 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)callableBy display name, for callers that genuinely start from text. Prefer the animation variable.
FDreamUIAnimationHandle PlayAnimationForward(UMovieSceneSequence* Animation, float PlaybackSpeed, bool bRestoreState)callablePlays 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)callableThe 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)callablePlays 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)callableUMG's PlaySound: a 2D sound for the owning player, with no attenuation and no world position.
void PreConstruct(bool bIsDesignTime)eventUMG's PreConstruct, with the flag it is named for.
void QueuePauseAnimation(FDreamUIAnimationHandle Handle)callableQueue Pause Animation
void QueuePlayAnimation(UMovieSceneSequence* Animation, float StartAtTime, int32 NumLoopsToPlay, EDreamUIAnimationPlayMode PlayMode, float PlaybackSpeed, bool bRestoreState)callableThe 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)callableQueue Play Animation Time Range
void QueueStopAllAnimations()callableQueue Stop All Animations
void QueueStopAnimation(FDreamUIAnimationHandle Handle)callableQueue Stop Animation
bool ReceiveAnalogValueChanged(UDreamKeyEventData* EventData)eventOn Analog Value Changed
void ReceiveFocusLost(int32 UserIndex, int32 PointerId)eventOn Focus Lost
void ReceiveFocusReceived(int32 UserIndex, int32 PointerId)eventOn Focus Received
bool ReceiveKeyChar(UDreamKeyEventData* EventData)eventOn Key Char
bool ReceiveKeyDown(UDreamKeyEventData* EventData)eventOn Key Down
bool ReceiveKeyUp(UDreamKeyEventData* EventData)eventOn Key Up
void RefreshEachBindings()callableRe-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)callableContinues a paused instance in the direction it was going.
void ReverseAnimation(FDreamUIAnimationHandle Handle)callableReverse Animation
void SetAlignmentInViewport(FVector2D InAlignment)callablePivot, in 0..1 of this widget's own box. UMG calls it alignment.
void SetAllowEventBubbleUp(bool Value)callableWhether pointer/drag events keep bubbling to ancestors after this widget has seen them.
void SetAnchorsInViewport(FVector2D InAnchorMin, FVector2D InAnchorMax)callableAnchors against the screen, min and max in 0..1. Both equal is a point anchor.
void SetAnimationCurrentTime(FDreamUIAnimationHandle Handle, float InTime)callableJumps the instance to a time in seconds without changing whether it is playing.
void SetCanNavigateHere(bool Value)callableOpt this widget in as a gamepad/keyboard navigation stop. Off, navigation ignores it entirely.
bool SetContentForNamedSlot(FName InSlotName, UDreamWidget* InContent)callableBind 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)callableSet Desired Size in Viewport
void SetNumLoopsToPlay(FDreamUIAnimationHandle Handle, int32 NumLoopsToPlay)callableChanges how many times a live instance plays in total. Zero loops indefinitely.
void SetOwningPlayer(APlayerController* InPlayerController)callablePoint this widget (and everything it goes on to create) at a different local player.
void SetPlaybackSpeed(FDreamUIAnimationHandle Handle, float PlaybackSpeed)callableSet Playback Speed
void SetPositionInViewport(FVector2D InPosition)callableUMG's SetPositionInViewport, and the three that go with it.
void SetWantsTick(bool Value)callableOpt this widget in or out of per-frame OnTick. Safe at any time, including from OnInitialized.
void StopAllAnimations()callableEvery animation on every component of this widget's own contents, nested instances excluded.
void StopAnimation(FDreamUIAnimationHandle Handle)callableEnds the instance where it is. Its Finished delegates fire, the same as a natural end.
void StopAnimationsOf(UMovieSceneSequence* Animation)callableStops every live instance of the animation.
void StopListeningForAllInputActions()callableStop Listening for All Input Actions
void StopListeningForInputAction(FDreamUIActionHandle InHandle)callableStop Listening for Input Action
void UnbindAllFromAnimationFinished(UMovieSceneSequence* Animation)callableUnbind All from Animation Finished
void UnbindAllFromAnimationStarted(UMovieSceneSequence* Animation)callableUnbind All from Animation Started
void UnbindFromAnimationFinished(UMovieSceneSequence* Animation, FDreamUIAnimationDynamicEvent Delegate)callableUnbind from Animation Finished
void UnbindFromAnimationStarted(UMovieSceneSequence* Animation, FDreamUIAnimationDynamicEvent Delegate)callableUnbind from Animation Started

Events

EventSignatureDescription
OnAnimationEventvoid DreamUIAnimEventDelegate__DelegateSignature(FName EventName)A DreamUI Event track key crossed while one of this widget's animations plays.

On this page