![]() |
Touch Interface Designer 2025.2
Create touch interface with a visual editor and manage all mobile inputs like gestures
|
#include <LayoutComponent.h>


Public Member Functions | |
| ULayoutComponent () | |
| virtual void | BeginDestroy () override |
| virtual TSharedRef< SLayoutComponent > | TakeWidget (SConstraintCanvas::FSlot *WidgetSlot, TSharedPtr< STouchInterface > LayoutWidget, ULocalPlayer *LocalPlayer, TSharedPtr< SLayoutComponent > InParent=nullptr) |
| UTextureRenderTarget2D * | GetCollapsedLayer () |
| FVector2D | GetComponentOffset () const |
| void | SetComponentOffset (const FVector2D InCenterOffset) |
| virtual void | UpdateScaleFactor (const FGeometry &LayoutGeometry, const float &ScaleFactor) |
| void | SetPortraitMode (const bool bEnable) |
| bool | IsInPortraitMode () const |
| bool | AllowPositionModification () const |
| bool | AllowSizeModification () const |
| virtual TSharedPtr< SLayoutComponent > | GetWidgetInstance () const |
| TSharedPtr< STouchInterface > | GetTouchInterfaceWidget () const |
| void | SetAnchor (const FAnchors NewAnchor) |
| void | SetTopLeftLocation (const FVector2D Value) |
| void | SetSize (const FVector2D Value) |
| FVector2D | GetParentSize () const |
| BlueprintCallable FAnchors | GetAnchor () const |
| BlueprintCallable FVector2D | GetAlignment () const |
| BlueprintPure FVector4f | GetAnchorOffset () const |
| virtual BlueprintPure FVector2D | GetComponentLocation () const |
| virtual BlueprintPure FVector2D | GetComponentTopLeftLocation () |
| virtual BlueprintPure FVector2D | GetComponentLocalLocation () const |
| virtual BlueprintPure FVector2D | GetLayoutTopLeftLocation () const |
| virtual BlueprintPure FVector2D | GetLayoutTopLeftCenterLocation () const |
| virtual BlueprintPure FVector2D | GetLayoutTopLeftLocationAtAlignment (FVector2D AtAlignment) |
| BlueprintPure float | GetComponentAngle () const |
| BlueprintPure FVector2D | GetComponentSize () const |
| virtual BlueprintPure FVector4f | GetComponentMaxOffset () const |
| BlueprintPure FVector2D | GetComponentSizeScale () const |
| virtual BlueprintCallable void | SetComponentAnchorPreset (const EAnchorPosition Anchor) |
| virtual BlueprintCallable void | SetComponentAlignment (const FVector2D NewAlignment) |
| virtual BlueprintCallable void | SetAnchorOffset (const FVector4f NewAnchorOffset) |
| virtual BlueprintCallable void | SetComponentLocation (const FVector2D NewLocation) |
| virtual BlueprintCallable void | SetComponentLocalLocation (const FVector2D NewLocation) |
| virtual BlueprintCallable void | SetComponentPortraitOffset (const FVector2D NewOffset) |
| virtual BlueprintCallable void | SetComponentAngle (const float Value) |
| virtual BlueprintCallable void | SetComponentSize (const FVector2D NewSize) |
| virtual BlueprintCallable void | SetComponentSizeScale (const FVector2D NewSizeScale) |
| virtual BlueprintPure bool | IsUnderLocation (const FVector2D AbsoluteLocation) |
| virtual BlueprintPure bool | CanInteract () const |
| virtual BlueprintCallable bool | IsPressed () const |
| virtual BlueprintCallable void | SetComponentVisibility (const bool bVisible) |
| virtual BlueprintCallable bool | IsVisible () |
| virtual BlueprintCallable void | Recenter (const FVector2D LayoutPosition=FVector2D::ZeroVector) |
| virtual BlueprintCallable void | ResetPosition () |
| virtual BlueprintCallable const FGeometry & | GetComponentGeometry () |
| virtual BlueprintPure bool | IsChild () const |
| BlueprintPure ULayoutComponent * | GetParent () const |
| BlueprintPure UTouchInterfaceLayout * | GetTouchInterfaceLayout () const |
| virtual BlueprintCallable void | RebuildDecorators () const |
| BlueprintCallable UComponentDecorator * | AddDecoratorByClass (TSubclassOf< UComponentDecorator > DecoratorClass, const FName Name) |
| BlueprintCallable void | AddDecorator (UComponentDecorator *Decorator) |
| BlueprintCallable UComponentDecorator * | InsertDecoratorByClassAt (TSubclassOf< UComponentDecorator > DecoratorClass, FName Name, int32 Index) |
| BlueprintCallable void | InsertDecoratorAt (UComponentDecorator *Decorator, int32 Index) |
| BlueprintCallable void | RemoveDecoratorByName (const FName Name) |
| BlueprintCallable void | RemoveDecoratorAt (const int32 Index) |
| BlueprintPure int32 | GetDecoratorIndex (const FName Name) |
| BlueprintPure UComponentDecorator * | GetDecoratorByName (const FName Name, bool bRecursive) |
| BlueprintPure UComponentDecorator * | GetDecoratorByIndex (const int32 Index) |
| BlueprintPure TArray< UComponentDecorator * > | GetAllDecorators (bool bRecursive) |
| BlueprintPure TArray< FName > | GetAllDecoratorNames (bool bRecursive) |
| BlueprintPure UProgressBarLayer * | GetDecoratorAsProgressBar (const FName LayerName) |
| BlueprintPure UTextLayer * | GetDecoratorAsText (const FName LayerName) |
| BlueprintPure UBlurLayer * | GetDecoratorAsBlur (const FName LayerName) |
| BlueprintPure UFlipbookLayer * | GetDecoratorAsFlipbook (const FName LayerName) |
| BlueprintPure UComponentDecoratorGroup * | GetDecoratorAsGroup (const FName LayerName) |
| BlueprintPure UWidgetLayer * | GetDecoratorAsWidget (const FName LayerName) |
| BlueprintPure bool | ContainDecoratorName (const FName Name, bool bRecursive=false) |
| BlueprintPure bool | ContainDecorator (UObject *LayerObject) |
| BlueprintPure bool | ContainDecoratorClass (TSubclassOf< UComponentDecorator > Class) |
| BlueprintCallable float | GetOpacity () const |
| BlueprintCallable void | SetOpacity (const float Value) |
| bool | HitPixel (const FVector2D NormalizedPosition, const float AlphaTolerance=0) |
| BlueprintCallable void | BeginEditDecorator (const FName LayerName) |
| BlueprintCallable void | EndEditDecorator () |
| bool | ConsumeInput () const |
| bool | CanRecenter () const |
| FVector2D | GetOffsetFromCenter () const |
| EInteractionType | GetInteractionShape () const |
| BlueprintPure float | GetInteractionSize () const |
| BlueprintCallable int32 | GetInputPriority () const |
| BlueprintCallable bool | IsConsumeInput () const |
| BlueprintPure ULayoutGroupComponent * | GetGroup () |
| BlueprintCallable void | SetInteractionSize (const float Value) |
| BlueprintCallable void | SetInputPriority (const int32 NewPriority) |
| BlueprintCallable void | SetConsumeInput (const bool Value) |
| BlueprintCallable void | EnableInput () |
| BlueprintCallable void | DisableInput () |
| BlueprintPure bool | IsInputEnabled () |
| BlueprintCallable UComponentLogic * | SetLogic (const TSubclassOf< UComponentLogic > NewLogicClass) |
Public Attributes | |
| Category ="Layout Component" | |
| BlueprintCallable | |
| meta | |
| EditAnywhere | |
| BlueprintReadOnly | |
| FVector2D | DesignLocation |
| BlueprintReadOnly FVector2D | PortraitOffset |
| FVector2D | DesignSize |
| TArray< TObjectPtr< UComponentDecorator > > | Decorators |
| BlueprintReadOnly uint8 | bIsVisible:1 |
| BlueprintReadOnly uint8 | bOptimizeRendering:1 |
| BlueprintReadOnly bool | bAllowLocationModification |
| BlueprintReadOnly FVector4f | MaxCenterOffset |
| BlueprintReadOnly uint8 | bAllowSizeModification:1 |
| BlueprintReadOnly FVector2D | MaxSizeScale |
| BlueprintReadOnly uint8 | bRecenterOnTouch:1 |
| BlueprintReadWrite EInteractionType | InteractionShape |
| BlueprintReadOnly uint8 | bConsumeInput:1 |
| Instanced TObjectPtr< UComponentLogic > | Logic |
Protected Attributes | |
| FVector2D | LayoutModifierOffset |
| float | CurrentSizeScale |
| TSharedPtr< SLayoutComponent > | ComponentWidget |
| TSharedPtr< STouchInterface > | TouchInterfaceWidget |
| TObjectPtr< UComponentLogic > | LogicCompInstance |
| FVector2D | OffsetFromCenter |
| FVector2D | TopLeftLocation |
Base class for component in touch interface layout
| ULayoutComponent::ULayoutComponent | ( | ) |
| void ULayoutComponent::AddDecorator | ( | UComponentDecorator * | Decorator | ) |
| UComponentDecorator * ULayoutComponent::AddDecoratorByClass | ( | TSubclassOf< UComponentDecorator > | DecoratorClass, |
| const FName | Name ) |
|
inline |
|
inline |
|
overridevirtual |
Reimplemented in ULayoutGroupComponent.
| void ULayoutComponent::BeginEditDecorator | ( | const FName | LayerName | ) |
|
virtual |
|
inline |
|
inline |
| bool ULayoutComponent::ContainDecorator | ( | UObject * | LayerObject | ) |
| bool ULayoutComponent::ContainDecoratorClass | ( | TSubclassOf< UComponentDecorator > | Class | ) |
| bool ULayoutComponent::ContainDecoratorName | ( | const FName | Name, |
| bool | bRecursive = false ) |
| void ULayoutComponent::DisableInput | ( | ) |
| void ULayoutComponent::EnableInput | ( | ) |
| void ULayoutComponent::EndEditDecorator | ( | ) |
|
inline |
| TArray< FName > ULayoutComponent::GetAllDecoratorNames | ( | bool | bRecursive | ) |
| TArray< UComponentDecorator * > ULayoutComponent::GetAllDecorators | ( | bool | bRecursive | ) |
|
inline |
|
inline |
| UTextureRenderTarget2D * ULayoutComponent::GetCollapsedLayer | ( | ) |
|
inline |
|
virtual |
|
virtual |
|
virtual |
|
inlinevirtual |
|
inline |
| FVector2D ULayoutComponent::GetComponentSize | ( | ) | const |
|
inline |
|
virtual |
| UBlurLayer * ULayoutComponent::GetDecoratorAsBlur | ( | const FName | LayerName | ) |
| UFlipbookLayer * ULayoutComponent::GetDecoratorAsFlipbook | ( | const FName | LayerName | ) |
| UComponentDecoratorGroup * ULayoutComponent::GetDecoratorAsGroup | ( | const FName | LayerName | ) |
| UProgressBarLayer * ULayoutComponent::GetDecoratorAsProgressBar | ( | const FName | LayerName | ) |
| UTextLayer * ULayoutComponent::GetDecoratorAsText | ( | const FName | LayerName | ) |
| UWidgetLayer * ULayoutComponent::GetDecoratorAsWidget | ( | const FName | LayerName | ) |
| UComponentDecorator * ULayoutComponent::GetDecoratorByIndex | ( | const int32 | Index | ) |
| UComponentDecorator * ULayoutComponent::GetDecoratorByName | ( | const FName | Name, |
| bool | bRecursive ) |
| int32 ULayoutComponent::GetDecoratorIndex | ( | const FName | Name | ) |
| ULayoutGroupComponent * ULayoutComponent::GetGroup | ( | ) |
|
inline |
|
inline |
|
inline |
|
virtual |
|
virtual |
|
virtual |
|
inline |
|
inline |
| ULayoutComponent * ULayoutComponent::GetParent | ( | ) | const |
| FVector2D ULayoutComponent::GetParentSize | ( | ) | const |
| UTouchInterfaceLayout * ULayoutComponent::GetTouchInterfaceLayout | ( | ) | const |
|
inline |
|
inlinevirtual |
| bool ULayoutComponent::HitPixel | ( | const FVector2D | NormalizedPosition, |
| const float | AlphaTolerance = 0 ) |
[EXPERIMENTAL] Tests whether or not there is a transparent pixel at the desired position in the decorator.
| void ULayoutComponent::InsertDecoratorAt | ( | UComponentDecorator * | Decorator, |
| int32 | Index ) |
| UComponentDecorator * ULayoutComponent::InsertDecoratorByClassAt | ( | TSubclassOf< UComponentDecorator > | DecoratorClass, |
| FName | Name, | ||
| int32 | Index ) |
|
virtual |
|
inline |
|
inline |
| bool ULayoutComponent::IsInputEnabled | ( | ) |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
| void ULayoutComponent::RemoveDecoratorAt | ( | const int32 | Index | ) |
| void ULayoutComponent::RemoveDecoratorByName | ( | const FName | Name | ) |
|
virtual |
| void ULayoutComponent::SetAnchor | ( | const FAnchors | NewAnchor | ) |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
inline |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
inline |
| void ULayoutComponent::SetInputPriority | ( | const int32 | NewPriority | ) |
| void ULayoutComponent::SetInteractionSize | ( | const float | Value | ) |
| UComponentLogic * ULayoutComponent::SetLogic | ( | const TSubclassOf< UComponentLogic > | NewLogicClass | ) |
|
inline |
| void ULayoutComponent::SetPortraitMode | ( | const bool | bEnable | ) |
| void ULayoutComponent::SetSize | ( | const FVector2D | Value | ) |
| void ULayoutComponent::SetTopLeftLocation | ( | const FVector2D | Value | ) |
|
virtual |
Reimplemented in ULayoutGroupComponent.
|
virtual |
| BlueprintReadOnly bool ULayoutComponent::bAllowLocationModification |
| BlueprintReadOnly uint8 ULayoutComponent::bAllowSizeModification |
| BlueprintReadOnly uint8 ULayoutComponent::bConsumeInput |
| BlueprintReadOnly uint8 ULayoutComponent::bIsVisible |
| ULayoutComponent::BlueprintCallable |
| ULayoutComponent::BlueprintReadOnly |
| BlueprintReadOnly uint8 ULayoutComponent::bOptimizeRendering |
| BlueprintReadOnly uint8 ULayoutComponent::bRecenterOnTouch |
| ULayoutComponent::Category ="Layout Component" |
Get component location in layout space. It's location from anchor. If you want location from Top Left, see GetComponentTopLeftLocation.
Get top left location of component. Act as if the alignment were located on the top left (0.0f, 0.0f)
Get component location in local space. If child, return offset from parent
Get component location in layout space. Act as if the anchors were located on the top left. FAnchor(0).
Get component location in layout space. Take alignment of component into account
Get component location in layout space at desired alignment of component Act as if the anchors were located on the top left. FAnchor(0).
Set component location in layout space. If you want to set offset from parent, use SetComponentLocalLocation.
Get group of this component. Be careful, can be null. Check with IsChild() before.
Rebuild all decorator in widget. Theoretically, you should not have to call this function. DO NOT CALL THIS FUNCTION EVERY FRAME.
Insert new decorator. Return instance of created decorator.
| DecoratorClass | decorator type. |
| Name | name of new decorator. |
| Index | Indicate order in array. Used as zorder, the smaller the index, the higher the priority given to drawing the decorator. |
Insert new decorator.
| Decorator | decorator instance. |
| Index | Indicate order in array. Used as zorder, the smaller the index, the higher the priority given to drawing the decorator. |
Returns decorator by name as a linear progress bar. Warning! Can be null.
Returns decorator by name as a text. Warning! Can be null.
Returns decorator by name as a blur. Warning! Can be null.
Returns decorator by name as a flipbook. Warning! Can be null.
Returns decorator by name as a decorator group. Warning! Can be null.
Returns decorator by name as a widget. Warning! Can be null.
Returns true if contain decorator with specified name.
| Name | Name of decorator |
| bRecursive | Check in decorator group |
Set the name of decorator that is modified. decorator ref will be cached until EndLayerEdit() was called. You can always edit decorator by referencing decorator name in function. Use this function to do multiple decorator modification in one frame (optimized).
Return group input component. Can return nullptr if this component is not in a group input.
Enable or not consume input. If enabled, block other component that is under finger's touch location with lower priority.
Layout space location of component. The scaling algorithm will not adapt the component position to the screen size.
Global size of component (geometry). Visual of component (Decorator) can be smaller or higher than geometry.
Location offset in portrait mode. By default portrait location value is exactly the same as landscape location value. but sometimes you may want to adjust the portrait location.
[EXPERIMENTAL] Collapse all layers into one. Faster rendering but need more step when decorator is modified. Do not use this if your decorator is modified frequently like progress bar.
Max offset allowed in layout modifier. X = Top, Y = Right, Z = Bottom, W = Left
Max size scale allowed in layout modifier. X = Min, Y = Max
If enabled, the component is re-centered when the user touches it. The maximum offset from origin is based on the interaction size.
Select the interaction shape to detect hit.
Global size of hit box (percentage of component size). By default, hit box has a size that match component size. If you want, you can adjust the size of hit box by increasing or decreasing this percentage. For example, if the component size is 150su (Slate Unit): 100% = 150su. 150% = 225su. 50% = 75su.
Enable or not the consume input. Used to decide which component receives the input if more than one hit box is affected (under pointer's location). If enabled, only components with a higher priority can receive inputs. If disabled, all components under this component will receive input.
Used to decide which component receives the input if more than one hit box is affected. A high priority allows this component to receive inputs in the event of a conflict with another component.
|
protected |
|
protected |
| TArray<TObjectPtr<UComponentDecorator> > ULayoutComponent::Decorators |
| FVector2D ULayoutComponent::DesignLocation |
Only used for layout modifier. Do not modify this property directly.
| FVector2D ULayoutComponent::DesignSize |
Only used for layout modifier. Do not modify this property directly.
| ULayoutComponent::EditAnywhere |
| BlueprintReadWrite EInteractionType ULayoutComponent::InteractionShape |
|
protected |
| Instanced TObjectPtr<UComponentLogic> ULayoutComponent::Logic |
|
protected |
| BlueprintReadOnly FVector4f ULayoutComponent::MaxCenterOffset |
| BlueprintReadOnly FVector2D ULayoutComponent::MaxSizeScale |
| ULayoutComponent::meta |
|
protected |
| BlueprintReadOnly FVector2D ULayoutComponent::PortraitOffset |
|
protected |
|
protected |