UUxtUIElementComponent
Controls visibility of a UI element in the scene.
Parent-child relationships are managed via actor attachments. If the parent is hidden, all of its children will be hidden. It is recommended to have the UxtUIElementComponent as the root component as the actor as this allows it to automatically update if the actor is attached to a new parent actor. If it is not the root component, RefreshUIElement() will need to be called manually after attaching a new parent actor.
Note: Manually changing actor visibility will not affect child UI elements and may lead to unwanted behavior.
class UUxtUIElementComponent;
Header
#include <Controls/UxtUIElementComponent.h>
Inheritance
Inherits from USceneComponent
Inherited by UUxtPinchSliderComponent, UUxtPressableButtonComponent, UUxtTouchableVolumeComponent
Public Functions
Name | |
---|---|
UUxtUIElementComponent() =default | |
EUxtUIElementVisibility | GetUIVisibilitySelf() const |
EUxtUIElementVisibility | GetUIVisibilityInHierarchy() const |
void | SetUIVisibility(EUxtUIElementVisibility NewVisibility) |
void | RefreshUIElement() |
Protected Functions
Name | |
---|---|
virtual void | BeginPlay() override |
virtual void | OnAttachmentChanged() override |
Public Attributes
Name | |
---|---|
FUxtUIElementShowDelegate | OnShowElement |
FUxtUIElementHideDelegate | OnHideElement |
Public Functions Documentation
function UUxtUIElementComponent
UUxtUIElementComponent() =default
function GetUIVisibilitySelf
EUxtUIElementVisibility GetUIVisibilitySelf() const
Get the element's visibility. This does not reflect if the element is visible in the scene.
function GetUIVisibilityInHierarchy
EUxtUIElementVisibility GetUIVisibilityInHierarchy() const
Get the element's visibility in the scene.
function SetUIVisibility
void SetUIVisibility(
EUxtUIElementVisibility NewVisibility
)
Set the element's visibility. The element will not be visible in the scene if it's parent is hidden.
function RefreshUIElement
void RefreshUIElement()
Refresh the element's visibility. This is only necessary after changing the element's parent actor when this is not the root component of the actor.
Protected Functions Documentation
function BeginPlay
virtual void BeginPlay() override
Reimplemented by: UUxtPinchSliderComponent::BeginPlay, UUxtPressableButtonComponent::BeginPlay, UUxtTouchableVolumeComponent::BeginPlay
function OnAttachmentChanged
virtual void OnAttachmentChanged() override
Public Attributes Documentation
variable OnShowElement
FUxtUIElementShowDelegate OnShowElement;
Event raised when the element is shown.
variable OnHideElement
FUxtUIElementHideDelegate OnHideElement;
Event raised when the element is hidden.
Updated on 19 August 2021 at 17:42:52 Coordinated Universal Time