Navigation
API > API/Runtime > API/Runtime/UMG > API/Runtime/UMG/Components
Inheritance Hierarchy
- UObject
- UVisual
- UWidget
- UPanelWidget
- UContentWidget
- UButton
- UUIFrameworkButtonWidget
References
| Module | UMG |
| Header | /Engine/Source/Runtime/UMG/Public/Components/Button.h |
| Include | #include "Components/Button.h" |
Syntax
UCLASS (MinimalAPI)
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 | |
|---|---|---|---|
| FLinearColor | BackgroundColor | The color multiplier for the button background | |
| TEnumAsByte< EButtonClickMethod::Type > | ClickMethod | The type of mouse action required by the user to trigger the buttons 'Click' | |
| FLinearColor | ColorAndOpacity | The color multiplier for the button content | |
| bool | IsFocusable | Sometimes a button should only be mouse-clickable and never keyboard focusable. | |
| 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 | ||
| TEnumAsByte< EButtonPressMethod::Type > | PressMethod | The type of keyboard/gamepad button press action required by the user to trigger the buttons 'Click' | |
| TEnumAsByte< EButtonTouchMethod::Type > | TouchMethod | The type of touch action required by the user to trigger the buttons 'Click' | |
| FButtonStyle | WidgetStyle | The button style used at runtime |
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 |
||
| void | PostLoad () |
Begin UObject. |
Overridden from UWidget
| Type | Name | Description | |
|---|---|---|---|
| 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 |