UUxtPressableButtonComponent
Component that turns the actor it is attached to into a pressable rectangular button.
class UUxtPressableButtonComponent;
Header
#include <Controls/UxtPressableButtonComponent.h>
Inheritance
Inherits from UUxtUIElementComponent, IUxtPokeTarget, IUxtPokeHandler, IUxtFarTarget, IUxtFarHandler, IUxtCollectionObject, USceneComponent
Public Functions
Name | |
---|---|
UUxtPressableButtonComponent() | |
float | GetFrontFaceCollisionFraction() const |
void | SetFrontFaceCollisionFraction(float Distance) |
USceneComponent * | GetVisuals() const |
void | SetVisuals(USceneComponent * Visuals) |
void | SetVisuals(const FComponentReference & ComponentReference) |
void | SetCollisionProfile(FName Profile) |
void | SetUseAbsolutePushDistance(bool bAbsolute) |
void | SetEnabled(bool Enabled) |
EUxtButtonState | GetState() const |
float | GetScaleAdjustedMaxPushDistance() const |
EUxtPushBehavior | GetPushBehavior() const |
void | SetPushBehavior(EUxtPushBehavior Behavior) |
float | GetMaxPushDistance() const |
void | SetMaxPushDistance(float Distance) |
bool | VisualBoundsFilter(const USceneComponent * Component) |
Protected Functions
Name | |
---|---|
virtual void | BeginPlay() override |
virtual void | TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction * ThisTickFunction) override |
virtual bool | IsPokeFocusable_Implementation(const UPrimitiveComponent * Primitive) const override |
virtual EUxtPokeBehaviour | GetPokeBehaviour_Implementation() const override |
virtual bool | GetClosestPoint_Implementation(const UPrimitiveComponent * Primitive, const FVector & Point, FVector & OutClosestPoint, FVector & OutNormal) const override |
virtual bool | CanHandlePoke_Implementation(UPrimitiveComponent * Primitive) const override |
virtual void | OnEnterPokeFocus_Implementation(UUxtNearPointerComponent * Pointer) override |
virtual void | OnUpdatePokeFocus_Implementation(UUxtNearPointerComponent * Pointer) override |
virtual void | OnExitPokeFocus_Implementation(UUxtNearPointerComponent * Pointer) override |
virtual void | OnBeginPoke_Implementation(UUxtNearPointerComponent * Pointer) override |
virtual void | OnUpdatePoke_Implementation(UUxtNearPointerComponent * Pointer) override |
virtual void | OnEndPoke_Implementation(UUxtNearPointerComponent * Pointer) override |
virtual bool | IsFarFocusable_Implementation(const UPrimitiveComponent * Primitive) const override |
virtual bool | CanHandleFar_Implementation(UPrimitiveComponent * Primitive) const override |
virtual void | OnEnterFarFocus_Implementation(UUxtFarPointerComponent * Pointer) override |
virtual void | OnUpdatedFarFocus_Implementation(UUxtFarPointerComponent * Pointer) override |
virtual void | OnExitFarFocus_Implementation(UUxtFarPointerComponent * Pointer) override |
virtual void | OnFarPressed_Implementation(UUxtFarPointerComponent * Pointer) override |
virtual void | OnFarReleased_Implementation(UUxtFarPointerComponent * Pointer) override |
Public Attributes
Name | |
---|---|
float | PressedFraction |
float | ReleasedFraction |
float | RecoverySpeed |
FUxtButtonBeginFocusDelegate | OnBeginFocus |
FUxtButtonUpdateFocusDelegate | OnUpdateFocus |
FUxtButtonEndFocusDelegate | OnEndFocus |
FUxtButtonBeginPokeDelegate | OnBeginPoke |
FUxtButtonUpdatePokeDelegate | OnUpdatePoke |
FUxtButtonEndPokeDelegate | OnEndPoke |
FUxtButtonPressedDelegate | OnButtonPressed |
FUxtButtonReleasedDelegate | OnButtonReleased |
FUxtButtonEnabledDelegate | OnButtonEnabled |
FUxtButtonDisabledDelegate | OnButtonDisabled |
Additional inherited members
Public Functions inherited from UUxtUIElementComponent
Name | |
---|---|
UUxtUIElementComponent() =default | |
EUxtUIElementVisibility | GetUIVisibilitySelf() const |
EUxtUIElementVisibility | GetUIVisibilityInHierarchy() const |
void | SetUIVisibility(EUxtUIElementVisibility NewVisibility) |
void | RefreshUIElement() |
Protected Functions inherited from UUxtUIElementComponent
Name | |
---|---|
virtual void | OnAttachmentChanged() override |
Public Attributes inherited from UUxtUIElementComponent
Name | |
---|---|
FUxtUIElementShowDelegate | OnShowElement |
FUxtUIElementHideDelegate | OnHideElement |
Public Functions inherited from IUxtPokeTarget
Name | |
---|---|
bool | IsPokeFocusable(const UPrimitiveComponent * Primitive) const |
EUxtPokeBehaviour | GetPokeBehaviour() const |
bool | GetClosestPoint(const UPrimitiveComponent * Primitive, const FVector & Point, FVector & OutClosestPoint, FVector & OutNormal) const |
Public Functions inherited from IUxtPokeHandler
Name | |
---|---|
bool | CanHandlePoke(UPrimitiveComponent * Primitive) const |
void | OnEnterPokeFocus(UUxtNearPointerComponent * Pointer) |
void | OnUpdatePokeFocus(UUxtNearPointerComponent * Pointer) |
void | OnExitPokeFocus(UUxtNearPointerComponent * Pointer) |
Public Functions inherited from IUxtFarTarget
Name | |
---|---|
bool | IsFarFocusable(const UPrimitiveComponent * Primitive) const |
Public Functions inherited from IUxtFarHandler
Name | |
---|---|
bool | CanHandleFar(UPrimitiveComponent * Primitive) const |
void | OnEnterFarFocus(UUxtFarPointerComponent * Pointer) |
void | OnUpdatedFarFocus(UUxtFarPointerComponent * Pointer) |
void | OnExitFarFocus(UUxtFarPointerComponent * Pointer) |
void | OnFarPressed(UUxtFarPointerComponent * Pointer) |
void | OnFarDragged(UUxtFarPointerComponent * Pointer) |
void | OnFarReleased(UUxtFarPointerComponent * Pointer) |
Public Functions inherited from IUxtCollectionObject
Name | |
---|---|
TScriptInterface< IUxtPokeTarget > | GetPokeTarget() |
TScriptInterface< IUxtFarTarget > | GetFarTarget() |
Public Functions Documentation
function UUxtPressableButtonComponent
UUxtPressableButtonComponent()
function GetFrontFaceCollisionFraction
float GetFrontFaceCollisionFraction() const
Get the distance from the visuals front face to the collider front face.
function SetFrontFaceCollisionFraction
void SetFrontFaceCollisionFraction(
float Distance
)
Set the distance from the visuals front face to the collider front face.
function GetVisuals
USceneComponent * GetVisuals() const
Get scene component used for the moving visuals
function SetVisuals
void SetVisuals(
USceneComponent * Visuals
)
Set scene component to be used for the moving visuals
function SetVisuals
void SetVisuals(
const FComponentReference & ComponentReference
)
Set scene component reference to be used for the moving visuals. This method should be called if the visual reference should be serialized.
function SetCollisionProfile
void SetCollisionProfile(
FName Profile
)
Set collision profile used by the button collider
function SetUseAbsolutePushDistance
void SetUseAbsolutePushDistance(
bool bAbsolute
)
Switch between world and local space for button distances
function SetEnabled
void SetEnabled(
bool Enabled
)
Set if the button is enabled
function GetState
EUxtButtonState GetState() const
Get the current state of the button
function GetScaleAdjustedMaxPushDistance
float GetScaleAdjustedMaxPushDistance() const
Gets the maximum distance the button can be pushed scaled by the transform's 'x' scale.
function GetPushBehavior
EUxtPushBehavior GetPushBehavior() const
Gets the button behavior when pushed
function SetPushBehavior
void SetPushBehavior(
EUxtPushBehavior Behavior
)
Sets the button behavior when pushed
function GetMaxPushDistance
float GetMaxPushDistance() const
Gets the maximum distance the button can be pushed
function SetMaxPushDistance
void SetMaxPushDistance(
float Distance
)
Sets the maximum distance the button can be pushed, does nothing when the push behavior is set to compress because the maximum distance is auto calculated
function VisualBoundsFilter
static bool VisualBoundsFilter(
const USceneComponent * Component
)
Filter function used by the button when calculating the hierarchy bounds of the visuals
Protected Functions Documentation
function BeginPlay
virtual void BeginPlay() override
Reimplements: UUxtUIElementComponent::BeginPlay
function TickComponent
virtual void TickComponent(
float DeltaTime,
ELevelTick TickType,
FActorComponentTickFunction * ThisTickFunction
) override
function IsPokeFocusable_Implementation
virtual bool IsPokeFocusable_Implementation(
const UPrimitiveComponent * Primitive
) const override
function GetPokeBehaviour_Implementation
virtual EUxtPokeBehaviour GetPokeBehaviour_Implementation() const override
function GetClosestPoint_Implementation
virtual bool GetClosestPoint_Implementation(
const UPrimitiveComponent * Primitive,
const FVector & Point,
FVector & OutClosestPoint,
FVector & OutNormal
) const override
function CanHandlePoke_Implementation
virtual bool CanHandlePoke_Implementation(
UPrimitiveComponent * Primitive
) const override
function OnEnterPokeFocus_Implementation
virtual void OnEnterPokeFocus_Implementation(
UUxtNearPointerComponent * Pointer
) override
function OnUpdatePokeFocus_Implementation
virtual void OnUpdatePokeFocus_Implementation(
UUxtNearPointerComponent * Pointer
) override
function OnExitPokeFocus_Implementation
virtual void OnExitPokeFocus_Implementation(
UUxtNearPointerComponent * Pointer
) override
function OnBeginPoke_Implementation
virtual void OnBeginPoke_Implementation(
UUxtNearPointerComponent * Pointer
) override
function OnUpdatePoke_Implementation
virtual void OnUpdatePoke_Implementation(
UUxtNearPointerComponent * Pointer
) override
function OnEndPoke_Implementation
virtual void OnEndPoke_Implementation(
UUxtNearPointerComponent * Pointer
) override
function IsFarFocusable_Implementation
virtual bool IsFarFocusable_Implementation(
const UPrimitiveComponent * Primitive
) const override
function CanHandleFar_Implementation
virtual bool CanHandleFar_Implementation(
UPrimitiveComponent * Primitive
) const override
function OnEnterFarFocus_Implementation
virtual void OnEnterFarFocus_Implementation(
UUxtFarPointerComponent * Pointer
) override
function OnUpdatedFarFocus_Implementation
virtual void OnUpdatedFarFocus_Implementation(
UUxtFarPointerComponent * Pointer
) override
function OnExitFarFocus_Implementation
virtual void OnExitFarFocus_Implementation(
UUxtFarPointerComponent * Pointer
) override
function OnFarPressed_Implementation
virtual void OnFarPressed_Implementation(
UUxtFarPointerComponent * Pointer
) override
function OnFarReleased_Implementation
virtual void OnFarReleased_Implementation(
UUxtFarPointerComponent * Pointer
) override
Public Attributes Documentation
variable PressedFraction
float PressedFraction = 0.5f;
Fraction of the maximum travel distance at which the button will raise the pressed event.
variable ReleasedFraction
float ReleasedFraction = 0.2f;
Fraction of the maximum travel distance at which a pressed button will raise the released event.
variable RecoverySpeed
float RecoverySpeed = 50;
Button movement speed while recovering in Unreal units per second (uu/s)
variable OnBeginFocus
FUxtButtonBeginFocusDelegate OnBeginFocus;
Event raised when a pointer starts focusing the button. WasFocused indicates if the button was already focused by another pointer.
variable OnUpdateFocus
FUxtButtonUpdateFocusDelegate OnUpdateFocus;
Event raised when a focusing pointer updates.
variable OnEndFocus
FUxtButtonEndFocusDelegate OnEndFocus;
Event raised when a pointer ends focusing the Pressable Button. IsFocused indicates if the Pressable Button is still focused by another pointer.
variable OnBeginPoke
FUxtButtonBeginPokeDelegate OnBeginPoke;
Event raised when a pointer starts poking the Pressable Button.
variable OnUpdatePoke
FUxtButtonUpdatePokeDelegate OnUpdatePoke;
Event raised while a pointer is poking the Pressable Button.
variable OnEndPoke
FUxtButtonEndPokeDelegate OnEndPoke;
Event raised when a pointer ends poking the Pressable Button.
variable OnButtonPressed
FUxtButtonPressedDelegate OnButtonPressed;
Event raised when the button reaches the pressed distance.
variable OnButtonReleased
FUxtButtonReleasedDelegate OnButtonReleased;
Event raised when the a pressed button reaches the released distance.
variable OnButtonEnabled
FUxtButtonEnabledDelegate OnButtonEnabled;
Event raised when the button is enabled.
variable OnButtonDisabled
FUxtButtonDisabledDelegate OnButtonDisabled;
Event raised when the button is disabled.
Updated on 2 November 2021 at 11:40:26 Coordinated Universal Time