AUxtPressableButtonActor
The default pressable button actor which programmatically builds an actor hierarchy with a back plate, front plate, icon, and label. All button properties within this class are reactive at edit and runtime. This actor also contains behaviors to support icon focus animation and sound playback. This class is extensible to support derived button types.
class AUxtPressableButtonActor;
Header
#include <Controls/UxtPressableButtonActor.h>
Inheritance
Inherits from AUxtBasePressableButtonActor, AActor, IUxtCollectionObject
Inherited by AUxtPressableToggleButtonActor
Public Functions
Name | |
---|---|
AUxtPressableButtonActor() | |
virtual void | OnConstruction(const FTransform & Transform) override |
virtual void | Tick(float DeltaTime) override |
virtual void | ConstructVisuals() |
virtual void | ConstructIcon() |
virtual void | ConstructLabel() |
bool | BeginPulse(const UUxtPointerComponent * Pointer) |
bool | IsPulsing() const |
FVector | GetMillimeterSize() const |
void | SetMillimeterSize(FVector Size) |
FVector | GetSize() const |
void | SetSize(FVector Size) |
bool | IsPlated() const |
void | SetIsPlated(bool IsPlated) |
const FUxtIconBrush & | GetIconBrush() const |
void | SetIconBrush(const FUxtIconBrush & Brush) |
const FText & | GetLabel() const |
void | SetLabel(const FText & NewLabel) |
const FUxtTextBrush & | GetLabelTextBrush() const |
void | SetLabelTextBrush(const FUxtTextBrush & Brush) |
const FUxtButtonBrush & | GetButtonBrush() const |
void | SetButtonBrush(const FUxtButtonBrush & Brush) |
Protected Functions
Name | |
---|---|
virtual void | OnButtonPressed(UUxtPressableButtonComponent * Button, UUxtPointerComponent * Pointer) |
virtual void | OnButtonReleased(UUxtPressableButtonComponent * Button, UUxtPointerComponent * Pointer) |
virtual void | OnBeginFocus(UUxtPressableButtonComponent * Button, UUxtPointerComponent * Pointer, bool WasAlreadyFocused) |
virtual void | OnButtonEnabled(UUxtPressableButtonComponent * Button) |
virtual void | OnButtonDisabled(UUxtPressableButtonComponent * Button) |
virtual bool | AnimatePulse(float DeltaTime) |
virtual bool | AnimateFocus(float DeltaTime) |
template <class T > T * |
CreateAndAttachComponent(FName Name, USceneComponent * Parent) |
Protected Attributes
Name | |
---|---|
FVector | MillimeterSize |
bool | bIsPlated |
FText | Label |
FUxtTextBrush | LabelTextBrush |
FUxtButtonBrush | ButtonBrush |
USceneComponent * | BackPlatePivotComponent |
UUxtBackPlateComponent * | BackPlateMeshComponent |
USceneComponent * | FrontPlatePivotComponent |
USceneComponent * | FrontPlateCenterComponent |
UStaticMeshComponent * | FrontPlateMeshComponent |
UTextRenderComponent * | IconComponent |
UTextRenderComponent * | LabelComponent |
UAudioComponent * | AudioComponent |
float | PulseTimer |
float | PulseFadeTimer |
UMaterialInterface * | PrePulseMaterial |
UMaterialInstanceDynamic * | PulseMaterialInstance |
uint32 | MaterialIndex |
float | FocusTimer |
bool | bCanEditIconBrush |
FUxtIconBrush | IconBrush |
Additional inherited members
Public Functions inherited from AUxtBasePressableButtonActor
Name | |
---|---|
AUxtBasePressableButtonActor() | |
TScriptInterface< IUxtPokeTarget > | GetPokeTarget() |
virtual TScriptInterface< IUxtPokeTarget > | GetPokeTarget_Implementation() override |
TScriptInterface< IUxtFarTarget > | GetFarTarget() |
virtual TScriptInterface< IUxtFarTarget > | GetFarTarget_Implementation() override |
UUxtPressableButtonComponent * | GetButtonComponent() const |
Protected Attributes inherited from AUxtBasePressableButtonActor
Name | |
---|---|
UUxtPressableButtonComponent * | ButtonComponent |
Public Functions inherited from IUxtCollectionObject
Name | |
---|---|
TScriptInterface< IUxtPokeTarget > | GetPokeTarget() |
TScriptInterface< IUxtFarTarget > | GetFarTarget() |
Public Functions Documentation
function AUxtPressableButtonActor
AUxtPressableButtonActor()
function OnConstruction
virtual void OnConstruction(
const FTransform & Transform
) override
Reimplemented by: AUxtPressableToggleButtonActor::OnConstruction
Creates (and initializes) the button hierarchy when properties are changed.
function Tick
virtual void Tick(
float DeltaTime
) override
Conditional tick method which occurs when a button needs to animate.
function ConstructVisuals
virtual void ConstructVisuals()
Reimplemented by: AUxtPressableToggleButtonActor::ConstructVisuals
Creates (and initializes) the button's visual hierarchy.
function ConstructIcon
virtual void ConstructIcon()
Reimplemented by: AUxtPressableRadioButtonActor::ConstructIcon
Creates (and initializes) the button's icon hierarchy.
function ConstructLabel
virtual void ConstructLabel()
Creates (and initializes) the button's label hierarchy.
function BeginPulse
bool BeginPulse(
const UUxtPointerComponent * Pointer
)
Starts the pulse animation for a given pointer.
function IsPulsing
inline bool IsPulsing() const
Returns true if a pulse is currently animating.
function GetMillimeterSize
inline FVector GetMillimeterSize() const
Accessor to the button size in millimeters.
function SetMillimeterSize
void SetMillimeterSize(
FVector Size
)
Sets the button size in millimeters.
function GetSize
inline FVector GetSize() const
Accessor to the button size in default units.
function SetSize
void SetSize(
FVector Size
)
Sets the button size in default units.
function IsPlated
inline bool IsPlated() const
Accessor to if the button is plated.
function SetIsPlated
void SetIsPlated(
bool IsPlated
)
Enables or disabled the button back plate.
function GetIconBrush
inline const FUxtIconBrush & GetIconBrush() const
Accessor to the button's icon brush.
function SetIconBrush
void SetIconBrush(
const FUxtIconBrush & Brush
)
Applies a new icon brush.
function GetLabel
inline const FText & GetLabel() const
Accessor to the button's label.
function SetLabel
void SetLabel(
const FText & NewLabel
)
Applies a new label.
function GetLabelTextBrush
inline const FUxtTextBrush & GetLabelTextBrush() const
Accessor to the button's label text brush.
function SetLabelTextBrush
void SetLabelTextBrush(
const FUxtTextBrush & Brush
)
Applies a new label text brush.
function GetButtonBrush
inline const FUxtButtonBrush & GetButtonBrush() const
Accessor to the button's button brush.
function SetButtonBrush
void SetButtonBrush(
const FUxtButtonBrush & Brush
)
Applies a new button brush.
Protected Functions Documentation
function OnButtonPressed
virtual void OnButtonPressed(
UUxtPressableButtonComponent * Button,
UUxtPointerComponent * Pointer
)
Reimplemented by: AUxtPressableToggleButtonActor::OnButtonPressed
Method which is invoked when the button is pressed.
function OnButtonReleased
virtual void OnButtonReleased(
UUxtPressableButtonComponent * Button,
UUxtPointerComponent * Pointer
)
Reimplemented by: AUxtPressableToggleButtonActor::OnButtonReleased
Method which is invoked when the button is released.
function OnBeginFocus
virtual void OnBeginFocus(
UUxtPressableButtonComponent * Button,
UUxtPointerComponent * Pointer,
bool WasAlreadyFocused
)
Method which is invoked when the button is focused on.
function OnButtonEnabled
virtual void OnButtonEnabled(
UUxtPressableButtonComponent * Button
)
Method which is invoked when the button is enabled.
function OnButtonDisabled
virtual void OnButtonDisabled(
UUxtPressableButtonComponent * Button
)
Method which is invoked when the button is disabled.
function AnimatePulse
virtual bool AnimatePulse(
float DeltaTime
)
Method to update the pulse animation and behavior. Returns true when the animation is complete.
function AnimateFocus
virtual bool AnimateFocus(
float DeltaTime
)
Method to update the focus animation and behavior. Returns true when the animation is complete.
function CreateAndAttachComponent
template <class T >
inline T * CreateAndAttachComponent(
FName Name,
USceneComponent * Parent
)
Utility method to allocate and add a scene component to the button.
Protected Attributes Documentation
variable MillimeterSize
FVector MillimeterSize = FVector(16, 32, 32);
The millimeter size of the button which dynamically resizes components within the button. This will preserve the actor scale.
variable bIsPlated
bool bIsPlated = true;
True if the button should display a back plate. Collections of buttons should share a common back plate.
variable Label
FText Label = NSLOCTEXT("PressableButtonActor", "LabelDefault", "16x32x32mm");
Localizable text for the label.
variable LabelTextBrush
FUxtTextBrush LabelTextBrush;
Text settings for the label.
variable ButtonBrush
FUxtButtonBrush ButtonBrush;
Structure which contains properties for the button's appearance and behavior.
variable BackPlatePivotComponent
USceneComponent * BackPlatePivotComponent = nullptr;
Pivot component to support back plate compression visuals.
variable BackPlateMeshComponent
UUxtBackPlateComponent * BackPlateMeshComponent = nullptr;
Back plate mesh component.
variable FrontPlatePivotComponent
USceneComponent * FrontPlatePivotComponent = nullptr;
Pivot component to support front plate compression visuals.
variable FrontPlateCenterComponent
USceneComponent * FrontPlateCenterComponent = nullptr;
The center of mass pivot of the front plate.
variable FrontPlateMeshComponent
UStaticMeshComponent * FrontPlateMeshComponent = nullptr;
Front plate mesh component.
variable IconComponent
UTextRenderComponent * IconComponent = nullptr;
Icon text component.
variable LabelComponent
UTextRenderComponent * LabelComponent = nullptr;
Label text component.
variable AudioComponent
UAudioComponent * AudioComponent = nullptr;
Audio playback component.
variable PulseTimer
float PulseTimer = -1;
The current animation time of the pulse animation.
variable PulseFadeTimer
float PulseFadeTimer = -1;
The current animation time of the pulse fade out animation.
variable PrePulseMaterial
UMaterialInterface * PrePulseMaterial = nullptr;
Handle to the original (unaltered) material before pulsing.
variable PulseMaterialInstance
UMaterialInstanceDynamic * PulseMaterialInstance = nullptr;
Handle to any dynamic material the pulse instantiates due to material parameter changes.
variable MaterialIndex
uint32 MaterialIndex = 0;
The active material based on which pointer triggered the pulse.
variable FocusTimer
float FocusTimer = 0;
The current animation time of the focus animation.
variable bCanEditIconBrush
bool bCanEditIconBrush = true;
Allows derived classes to control if the icon brush can be edited.
variable IconBrush
UPROPERTY(EditAnywhere, Category="Uxt Pressable Button", BlueprintGetter="GetIconBrush", BlueprintSetter="SetIconBrush", meta=(EditCondition="bCanEditIconBrush"))
FUxtIconBrush IconBrush;
Structure which contains properties for the button's icon.
Updated on 2 November 2021 at 11:40:25 Coordinated Universal Time