Navigation
API > API/Runtime > API/Runtime/UMG > API/Runtime/UMG/Components
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UVisual
- UWidget
- UPanelWidget
- UContentWidget
- UButton
- UCommonButtonInternalBase
- UEditorUtilityButton
- UUIFrameworkButtonWidget
References
| Module | UMG |
| Header | /Engine/Source/Runtime/UMG/Public/Components/Button.h |
| Include | #include "Components/Button.h" |
Syntax
class UButton : public UContentWidget
Remarks
The button is a click-able primitive widget to enable basic interaction, you can place any other widget inside a button to make a more complex and interesting click-able element in your UI.
- Single Child
- Clickable
Variables
| Type | Name | Description | |
|---|---|---|---|
| TSharedPtr< SButton > | MyButton | Cached pointer to the underlying slate button owned by this UWidget | |
| FOnButtonClickedEvent | OnClicked | Called when the button is clicked | |
| FOnButtonHoverEvent | OnHovered | ||
| FOnButtonPressedEvent | OnPressed | Called when the button is pressed | |
| FOnButtonReleasedEvent | OnReleased | Called when the button is released | |
| FOnButtonHoverEvent | OnUnhovered |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UButton
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| FLinearColor | |||
| EButtonClickMethod::Type | |||
| FLinearColor | |||
| bool | |||
| EButtonPressMethod::Type | |||
| const FButtonStyle & | GetStyle () |
||
| EButtonTouchMethod::Type | |||
| void | InitIsFocusable
(
bool InIsFocusable |
Initialize IsFocusable in the constructor before the SWidget is constructed. | |
| bool | IsPressed () |
Returns true if the user is actively pressing the button. | |
| void | SetBackgroundColor
(
FLinearColor InBackgroundColor |
Sets the color multiplier for the button background | |
| void | SetClickMethod
(
EButtonClickMethod::Type InClickMethod |
||
| void | SetColorAndOpacity
(
FLinearColor InColorAndOpacity |
Sets the color multiplier for the button content | |
| void | SetPressMethod
(
EButtonPressMethod::Type InPressMethod |
||
| void | SetStyle
(
const FButtonStyle& InStyle |
Sets the color multiplier for the button background | |
| void | SetTouchMethod
(
EButtonTouchMethod::Type InTouchMethod |
||
| FReply | Handle the actual click event from slate and forward it on | ||
| void | |||
| void | |||
| void | |||
| void |
Overridden from UPanelWidget
| Type | Name | Description | |
|---|---|---|---|
| UClass * | GetSlotClass () |
UPanelWidget. | |
| void | OnSlotAdded
(
UPanelSlot* Slot |
||
| void | OnSlotRemoved
(
UPanelSlot* Slot |
Overridden from UWidget
| Type | Name | Description | |
|---|---|---|---|
| TSharedPtr< SWidget > | Gets the widget that accessibility properties should synchronize to. | ||
| const FText | Gets the palette category of the widget | ||
| 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. | ||
| void | Applies all properties to the native widget if possible. |
Overridden from UVisual
| Type | Name | Description | |
|---|---|---|---|
| void | ReleaseSlateResources
(
bool bReleaseChildren |
Overridden from UObject
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| FLinearColor | BackgroundColor | Direct access to BackgroundColor is deprecated. Please use the getter and setter. | |
| TEnumAsByte< EButtonClickMethod::Type > | ClickMethod | Direct access to ClickMethod is deprecated. Please use the getter and setter. | |
| FLinearColor | ColorAndOpacity | Direct access to ColorAndOpacity is deprecated. Please use the getter and setter. | |
| bool | IsFocusable | Direct access to IsFocusable is deprecated. Please use the getter. | |
| TEnumAsByte< EButtonPressMethod::Type > | PressMethod | Direct access to PressMethod is deprecated. Please use the getter and setter. | |
| TEnumAsByte< EButtonTouchMethod::Type > | TouchMethod | Direct access to TouchMethod is deprecated. Please use the getter and setter. | |
| FButtonStyle | WidgetStyle | Direct access to WidgetStyle is deprecated. Please use the getter and setter. |