Navigation
API > API/Runtime > API/Runtime/UMG > API/Runtime/UMG/Components
Inheritance Hierarchy
- UObject
- UVisual
- UWidget
- UAudioMeter
- UAudioOscilloscope
- UAudioRadialSlider
- UAudioFrequencyRadialSlider
- UAudioVolumeRadialSlider
- UAudioSliderBase
- UAudioFrequencySlider
- UAudioSlider
- UAudioVolumeSlider
- UAudioVectorscope
- UCircularThrobber
- UComboBox
- UComboBoxKey
- UComboBoxString
- UDynamicEntryBoxBase
- UDynamicEntryBox
- UEditableText
- UEditableTextBox
- UExpandableArea
- UImage
- UInputKeySelector
- UListViewBase
- UListView
- UTileView
- UTreeView
- UNativeWidgetHost
- UObjectMixerEditorUWidget
- UPanelWidget
- UCanvasPanel
- UContentWidget
- UBackgroundBlur
- UBorder
- UButton
- UCheckBox
- UInvalidationBox
- UMenuAnchor
- UNamedSlot
- URetainerBox
- USafeZone
- UScaleBox
- USizeBox
- UViewport
- UWindowTitleBarArea
- UGridPanel
- UHorizontalBox
- UOverlay
- UScrollBox
- UStackBox
- UUniformGridPanel
- UVerticalBox
- UWidgetSwitcher
- UWrapBox
- UPostBufferUpdate
- UProgressBar
- UScrollBar
- USlider
- USpacer
- USpinBox
- UTextLayoutWidget
- UMultiLineEditableText
- UMultiLineEditableTextBox
- URichTextBlock
- UTextBlock
- UThrobber
- UUserWidget
- UMoviePipelineBurnInWidget
- UTakeRecorderOverlayWidget
- UVCamWidget
- UVCamStateSwitcherWidget
- UVPAssetThumbnailWrapperWidget
- UWebBrowser
References
| Module | UMG |
| Header | /Engine/Source/Runtime/UMG/Public/Components/Widget.h |
| Include | #include "Components/Widget.h" |
Syntax
UCLASS (Abstract, BlueprintType, Blueprintable, CustomFieldNotify, MinimalAPI)
class UWidget :
public UVisual ,
public INotifyFieldValueChanged
Remarks
This is the base class for all wrapped Slate controls that are exposed to UObjects.
Variables
| Type | Name | Description | |
|---|---|---|---|
| ESlateAccessibleBehavior | AccessibleBehavior | Whether or not the widget is accessible, and how to describe it. | |
| ESlateAccessibleBehavior | AccessibleSummaryBehavior | How to describe this widget when it's being presented through a summary of a parent widget. | |
| FText | AccessibleSummaryText | When AccessibleSummaryBehavior is set to Custom, this is the text that will be used to describe the widget. | |
| USlateAccessibleWidgetData::FGetText | AccessibleSummaryTextDelegate | An optional delegate that may be assigned in place of AccessibleSummaryText for creating a TAttribute | |
| FText | AccessibleText | When AccessibleBehavior is set to Custom, this is the text that will be used to describe the widget. | |
| USlateAccessibleWidgetData::FGetText | AccessibleTextDelegate | An optional delegate that may be assigned in place of AccessibleText for creating a TAttribute | |
| uint8: 1 | bCanChildrenBeAccessible | Whether or not children of this widget can appear as distinct accessible widgets. | |
| uint8: 1 | bCreatedByConstructionScript | Flag if the Widget was created from a blueprint | |
| uint8: 1 | bExpandedInDesigner | Stores the design time flag setting if the widget is expanded inside the designer | |
| uint8: 1 | bHiddenInDesigner | Stores the design time flag setting if the widget is hidden inside the designer | |
| uint8: 1 | bIsEnabled | Sets whether this widget can be modified interactively by the user | |
| FGetBool | bIsEnabledDelegate | A bindable delegate for bIsEnabled | |
| uint8: 1 | bIsManagedByGameViewportSubsystem | Cached value that indicate if the widget was added to the GameViewportSubsystem. | |
| uint8: 1 | bIsVariable | Allows controls to be exposed as variables in a blueprint. | |
| uint8: 1 | bIsVolatile | If true prevents the widget or its child's geometry or layout information from being cached. | |
| uint8: 1 | bLockedInDesigner | Stores the design time flag setting if the widget is locked inside the designer | |
| uint8: 1 | bOverride_Cursor | ||
| uint8: 1 | bOverrideAccessibleDefaults | These editor-only properties exist for two reasons: | |
| bool | bShouldBroadcastState | False will skip state broadcasts. | |
| EWidgetClipping | Clipping | Controls how the clipping behavior of this widget. | |
| TEnumAsByte< EMouseCursor::Type > | Cursor | The cursor to show when the mouse is over the widget | |
| EFlowDirectionPreference | FlowDirectionPreference | Allows you to set a new flow direction | |
| TWeakPtr< SObjectWidget > | MyGCWidget | The underlying SWidget contained in a SObjectWidget | |
| TWeakPtr< SWidget > | MyWidget | The underlying SWidget. | |
| TSharedPtr< FWidgetStateBitfield > | MyWidgetStateBitfield | The bitfield for this widget's state | |
| TArray< TObjectPtr< UPropertyBinding > > | NativeBindings | Native property bindings. | |
| TObjectPtr< class UWidgetNavigation > | Navigation | The navigation object for this widget is optionally created if the user has configured custom navigation rules for this widget in the widget designer. | |
| FOnWidgetStateBroadcast | PostWidgetStateChanged | Delegate that broadcasts after current widget state has fully changed, including all state-related side effects | |
| float | RenderOpacity | The opacity of the widget | |
| FWidgetTransform | RenderTransform | The render transform of the widget allows for arbitrary 2D transforms to be applied to the widget. | |
| FVector2D | RenderTransformPivot | The render transform pivot controls the location about which transforms are applied. | |
| TObjectPtr< UPanelSlot > | Slot | The parent slot of the UWidget. | |
| FText | ToolTipText | Tooltip text to show when the user hovers over the widget with the mouse | |
| FGetText | ToolTipTextDelegate | A bindable delegate for ToolTipText | |
| TObjectPtr< UWidget > | ToolTipWidget | Tooltip widget to show when the user hovers over the widget with the mouse | |
| FGetWidget | ToolTipWidgetDelegate | A bindable delegate for ToolTipWidget | |
| friend | UGameViewportSubsystem | ||
| ESlateVisibility | Visibility | The visibility of the widget | |
| FGetSlateVisibility | VisibilityDelegate | A bindable delegate for Visibility | |
| TWeakObjectPtr< UObject > | WidgetGeneratedBy | Stores a reference to the asset responsible for this widgets construction. | |
| TWeakObjectPtr< UClass > | WidgetGeneratedByClass | Stores a reference to the class responsible for this widgets construction. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UWidget
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | AddBinding
(
FDelegateProperty* DelegateProperty, |
||
| FDelegateHandle | AddFieldValueChangedDelegate
(
UE::FieldNotification::FFieldId InFieldId, |
||
| void | BroadcastBinaryPostStateChange
(
const FWidgetStateBitfield& StateChange, |
Broadcast a binary state post change | |
| void | BroadcastEnumPostStateChange
(
const FWidgetStateBitfield& StateChange |
Broadcast an enum state post change | |
| void | BroadcastFieldValueChanged
(
UE::FieldNotification::FFieldId InFieldId |
||
| void | Called by the owning user widget after the slate widget has been created. | ||
| bool | |||
| bool | |||
| bool | |||
| void | Allows general fixups and connections only used at editor time. | ||
| TOptional< float > | ConvertFloatToOptionalFloat
(
TAttribute< float > InFloat |
||
| FSlateColor | ConvertLinearColorToSlateColor
(
TAttribute< FLinearColor > InLinearColor |
||
| ESlateVisibility | ConvertRuntimeToSerializedVisibility
(
const EVisibility& Input |
||
| FSizeParam | ConvertSerializedSizeParamToRuntime
(
const FSlateChildSize& Input |
||
| EVisibility | End Designer contextual events. | ||
| EVisibility | ConvertVisibility
(
TAttribute< ESlateVisibility > SerializedType |
TODO UMG Consider moving conversion functions into another class. Conversion functions | |
| TSharedRef< SWidget > | CreateDesignerOutline
(
TSharedRef< SWidget > Content |
||
| void | Called by the palette after constructing a new widget. | ||
| void | |||
| TSubclassOf< UPropertyBinding > | FindBinderClassForDestination
(
FProperty* Property |
||
| UWidget * | FindChildContainingDescendant
(
UWidget* Root, |
||
| void | |||
| void | Forces a pre-pass. | ||
| void | ForceVolatile
(
bool bForce |
Sets the forced volatility of the widget. | |
| FText | Gets the accessible summary text from the underlying Slate accessible widget. | ||
| FText | Gets the accessible text from the underlying Slate accessible widget | ||
| const FGeometry & | Gets the last geometry used to Tick the widget. | ||
| TSharedPtr< SWidget > | Gets the last created widget does not recreate the gc container for the widget if one is needed. | ||
| const FString & | Returns the category name of the widget | ||
| EWidgetClipping | GetClipping () |
Gets the clipping state of this widget. | |
| EMouseCursor::Type | GetCursor () |
Sets the cursor to show over the widget. | |
| FString | |||
| EWidgetDesignFlags | Gets the designer flags currently set on the widget. | ||
| FVector2D | Gets the widgets desired size. | ||
| const FString & | Returns the friendly name of the widget to display in the editor | ||
| FText | Gets the base name used to generate the display label/name of this widget. | ||
| EFlowDirectionPreference | Gets the flow direction preference of the widget | ||
| TGameInstance * | Gets the game instance associated with this UI. | ||
| UGameInstance * | Gets the game instance associated with this UI. | ||
| bool | GetIsEnabled () |
Gets the current enabled status of the widget | |
| FString | Get Label Metadata, which may be as simple as a bit of string data to help identify an anonymous text block. | ||
| FText | GetLabelText () |
Gets the label to display to the user for this widget. | |
| FText | Gets the label to display to the user for this widget, including any extra metadata like the text string for text. | ||
| T * | Gets the local player associated with this UI cast to the template type. | ||
| ULocalPlayer * | Gets the local player associated with this UI. | ||
| TPlayerController * | Gets the player controller associated with this UI cast to the template type. | ||
| APlayerController * | Gets the player controller associated with this UI. | ||
| const FGeometry & | |||
| const FText | Gets the palette category of the widget | ||
| UPanelWidget * | GetParent () |
Gets the parent widget | |
| EWidgetPixelSnapping | Gets the pixel snapping method of this widget. | ||
| float | Gets the current visibility of the widget. | ||
| const FWidgetTransform & | |||
| float | |||
| FVector2D | |||
| UObject * | |||
| const FGeometry & | |||
| UWidget * | GetToolTip () |
||
| FText | |||
| ESlateVisibility | Gets the current visibility of the widget. | ||
| EVisibility | This is an implementation detail that allows us to show and hide the widget in the designer regardless of the actual visibility state set by the user. | ||
| UWorld * | GetWorld () |
||
| bool | HasAnyDesignerFlags
(
EWidgetDesignFlags FlagsToCheck |
Tests if any of the flags exist on this widget. | |
| bool | Returns true if this widget is focused by any user. | ||
| bool | Returns true if any descendant widget is focused by any user. | ||
| bool | Checks to see if this widget currently has the keyboard focus | ||
| bool | Checks to see if this widget is the current mouse captor | ||
| bool | HasMouseCaptureByUser
(
int32 UserIndex, |
Checks to see if this widget is the current mouse captor | |
| bool | HasUserFocus
(
APlayerController* PlayerController |
Returns true if this widget is focused by a specific user. | |
| bool | HasUserFocusedDescendants
(
APlayerController* PlayerController |
Returns true if any descendant widget is focused by a specific user. | |
| void | Invalidates the widget from the view of a layout caching widget that may own this widget. | ||
| bool | Recurses up the list of parents and returns true if this widget is a descendant of the PossibleParent | ||
| bool | Gets the last created widget does not recreate the gc container for the widget if one is needed. | ||
| bool | IsDesignTime () |
Returns if the widget is currently being displayed in the designer, it may want to display different data. | |
| bool | |||
| bool | Is the label generated or provided by the user? | ||
| bool | IsHovered () |
Returns true if the widget is currently being hovered by a pointer device | |
| bool | IsInViewport () |
||
| bool | Is this widget locked in the designer UI | ||
| bool | |||
| bool | IsRendered () |
Returns true if the widget is Visible, HitTestInvisible or SelfHitTestInvisible and the Render Opacity is greater than 0. | |
| bool | IsVisible () |
Returns true if the widget is Visible, HitTestInvisible or SelfHitTestInvisible. | |
| bool | Is the widget visible in the designer? If this widget is 'hidden in the designer' or a parent is, this widget will also return false here. | ||
| void | K2_AddFieldValueChangedDelegate
(
FFieldNotificationId FieldId, |
||
| void | K2_BroadcastFieldValueChanged
(
FFieldNotificationId FieldId |
||
| void | K2_RemoveFieldValueChangedDelegate
(
FFieldNotificationId FieldId, |
||
| bool | Modify
(
bool bAlwaysMarkDirty |
Mark this object as modified, also mark the slot as modified. | |
| void | |||
| void | OnBindingChanged
(
const FName& Property |
||
| void | Called after constructing a new widget from the palette. | ||
| void | OnDescendantDeselectedByDesigner
(
UWidget* DescendantWidget |
||
| void | OnDescendantSelectedByDesigner
(
UWidget* DescendantWidget |
||
| void | |||
| void | OnDesignerChanged
(
const FDesignerChangedEventArgs& EventArgs |
||
| void | |||
| void | |||
| void | Function called after the underlying SWidget is constructed. | ||
| void | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
||
| void | PreSave
(
FObjectPreSaveContext ObjectSaveContext |
||
| TSharedRef< SWidget > | RebuildDesignWidget
(
TSharedRef< SWidget > Content |
||
| TSharedRef< SWidget > | Function implemented by all subclasses of UWidget is called when the underlying SWidget needs to be constructed. | ||
| FDelegateHandle | RegisterPostStateListener
(
const FOnWidgetStateBroadcast::FDelegate& ListenerDelegate, |
Add a post-state-changed listener to this widget, will fire after a state changed and all related side effects are resolved. | |
| int32 | RemoveAllFieldValueChangedDelegates
(
const void* InUserObject |
||
| int32 | RemoveAllFieldValueChangedDelegates
(
UE::FieldNotification::FFieldId InFieldId, |
||
| bool | RemoveFieldValueChangedDelegate
(
UE::FieldNotification::FFieldId InFieldId, |
||
| void | Removes the widget from its parent widget. | ||
| void | ResetCursor () |
Resets the cursor to use on the widget, removing any customization for it. | |
| void | Begin Designer contextual events. | ||
| void | SetAllNavigationRules
(
EUINavigationRule Rule, |
Sets the widget navigation rules for all directions. | |
| void | SetCategoryName
(
const FString& InValue |
Sets the category name of the widget | |
| void | SetClipping
(
EWidgetClipping InClipping |
Sets the clipping state of this widget. | |
| void | SetCursor
(
EMouseCursor::Type InCursor |
Sets the cursor to show over the widget. | |
| void | SetDesignerFlags
(
EWidgetDesignFlags NewFlags |
Sets the designer flags on the widget. | |
| void | SetDisplayLabel
(
const FString& DisplayLabel |
Sets the friendly name of the widget to display in the editor | |
| void | SetFlowDirectionPreference
(
EFlowDirectionPreference FlowDirection |
Sets the flow direction preference of the widget | |
| void | SetFocus () |
Sets the focus to this widget for the owning user | |
| void | SetIsEnabled
(
bool bInIsEnabled |
Sets the current enabled status of the widget | |
| void | Sets the focus to this widget. | ||
| void | SetLockedInDesigner
(
bool NewLockedInDesigner |
||
| void | SetNavigationRule
(
EUINavigation Direction, |
Sets the widget navigation rules for a specific direction. | |
| void | SetNavigationRuleBase
(
EUINavigation Direction, |
Sets the widget navigation rules for a specific direction. | |
| void | SetNavigationRuleCustom
(
EUINavigation Direction, |
Sets the widget navigation rules for a specific direction. | |
| void | SetNavigationRuleCustomBoundary
(
EUINavigation Direction, |
Sets the widget navigation rules for a specific direction. | |
| void | SetNavigationRuleExplicit
(
EUINavigation Direction, |
Sets the widget navigation rules for a specific direction. | |
| void | SetNavigationRuleInternal
(
EUINavigation Direction, |
||
| void | SetPixelSnapping
(
EWidgetPixelSnapping InPixelSnapping |
Sets the pixel snapping method of this widget. | |
| void | SetRenderOpacity
(
float InOpacity |
Sets the visibility of the widget. | |
| void | SetRenderScale
(
FVector2D Scale |
||
| void | SetRenderShear
(
FVector2D Shear |
||
| void | SetRenderTransform
(
FWidgetTransform InTransform |
||
| void | SetRenderTransformAngle
(
float Angle |
||
| void | SetRenderTransformPivot
(
FVector2D Pivot |
||
| void | SetRenderTranslation
(
FVector2D Translation |
||
| void | SetToolTip
(
UWidget* Widget |
Sets a custom widget as the tooltip of the widget. | |
| void | SetToolTipText
(
const FText& InToolTipText |
Sets the tooltip text for the widget. | |
| void | SetUserFocus
(
APlayerController* PlayerController |
Sets the focus to this widget for a specific user (if setting focus for the owning user, prefer SetFocus()) | |
| void | SetVisibility
(
ESlateVisibility InVisibility |
Sets the visibility of the widget. | |
| void | SetVisibilityInternal
(
ESlateVisibility InVisibility |
||
| void | Copy all accessible properties to the AccessibleWidgetData object | ||
| void | Applies all properties to the native widget if possible. | ||
| TSharedRef< WidgetType > | TakeDerivedWidget
(
ConstructMethodType ConstructMethod |
||
| TSharedRef< SWidget > | TakeWidget () |
Gets the underlying slate widget or constructs it if it doesn't exist. | |
| void | UnregisterPostStateListener
(
const FDelegateHandle& ListenerDelegate |
Remove a post-state-changed listener from this widget, resets state bitfield if no other state listeners exist | |
| void | |||
| void | ValidateCompiledDefaults
(
IWidgetCompilerLog& CompileLog |
Called at the end of Widget Blueprint compilation. |
Overridden from UVisual
| Type | Name | Description | |
|---|---|---|---|
| void | BeginDestroy () |
||
| void | ReleaseSlateResources
(
bool bReleaseChildren |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FGenerateWidgetForObject | |||
| FGenerateWidgetForString | Events. | ||
| FGetBool | Common Bindings - If you add any new common binding, you must provide a UPropertyBinding for it. | ||
| FGetCheckBoxState | |||
| FGetFloat | |||
| FGetInt32 | |||
| FGetLinearColor | |||
| FGetMouseCursor | |||
| FGetSlateBrush | |||
| FGetSlateColor | |||
| FGetSlateVisibility | |||
| FGetText | |||
| FGetWidget | |||
| FOnPointerEvent | |||
| FOnReply | Events. |
Typedefs
| Name | Description |
|---|---|
| ConstructMethodType | |
| FOnWidgetStateBroadcast |
Constants
| Name | Description |
|---|---|
| BinderClasses |