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


Public Member Functions | |
| UTouchInterfaceSubsystem () | |
| virtual bool | ShouldCreateSubsystem (UObject *Outer) const override |
| virtual void | Initialize (FSubsystemCollectionBase &Collection) override |
| virtual void | Deinitialize () override |
| BlueprintCallable bool | RegisterTouchListenerComponent (UTouchInterfaceListener *Listener) |
| BlueprintCallable bool | UnregisterTouchListenerComponent (UTouchInterfaceListener *Listener) |
| UVirtualInputEvent * | CreateAndRegisterVirtualInputEvent (TSubclassOf< UVirtualInputEvent > Class) |
| virtual BlueprintCallable UTouchInterfaceLayout * | AddTouchInterface (UTouchInterfaceLayout *Layout=nullptr, const bool bLoadSave=false, const int32 SnapshotID=0) |
| virtual BlueprintCallable void | RemoveTouchInterface () |
| TSharedPtr< SDeprecatedTouchInterface > | GetTouchInterfaceInstance () |
| TSharedPtr< STouchInterfaceRuntime > | GetTouchInterfaceWidget () |
| BlueprintPure UTouchInterfaceLayout * | GetLayoutInstance () const |
| BlueprintCallable const FGeometry & | GetTouchInterfaceGeometry () const |
| virtual BlueprintCallable void | ShowTouchInterface () |
| virtual BlueprintCallable void | HideTouchInterface () |
| virtual BlueprintCallable void | ShowVirtualControl (const FName Name, bool bIncludeChild) |
| virtual BlueprintCallable void | HideVirtualControl (const FName Name, bool bIncludeChild) |
| virtual BlueprintCallable void | ShowAllVirtualInput () |
| virtual BlueprintCallable void | HideAllVirtualInput () |
| virtual BlueprintCallable void | ShowAllExcept (const FName Name) |
| virtual BlueprintCallable void | HideAllExcept (const FName Name) |
| virtual BlueprintCallable void | ShowAllExceptNamedOnes (const TArray< FName > Names) |
| virtual BlueprintCallable void | HideAllExceptNamedOnes (const TArray< FName > Names) |
| BlueprintCallable float | GetVirtualInputOpacity (const FName InputName) |
| BlueprintCallable void | SetVirtualInputOpacity (const FName InputName, const float NewOpacity) |
| virtual BlueprintCallable UVirtualShapeDrawer * | AddDrawer (TSubclassOf< UVirtualShapeDrawer > Drawer, int32 ZOrder=1) |
| BlueprintPure UVirtualShapeDrawer * | GetDrawerInstance () const |
| virtual BlueprintCallable void | ShowDrawer () |
| virtual BlueprintCallable void | HideDrawer () |
| virtual BlueprintCallable void | RemoveDrawer () |
| virtual BlueprintCallable void | EnableInput () |
| virtual BlueprintCallable void | DisableInput () |
| virtual BlueprintCallable void | DisableVirtualInput (const FName InputName) |
| virtual BlueprintCallable void | EnableGesture () |
| virtual BlueprintCallable void | DisableGesture () |
| virtual BlueprintCallable void | TryRecognizeShape () |
| BlueprintCallable bool | SetInputAction (const FName ControlName, UInputAction *InputAction) |
| virtual BlueprintCallable bool | GetVirtualControlDataByRef (const FName ControlName, FVirtualControl &Data) |
| virtual BlueprintCallable FVirtualControl & | GetVirtualControlDataRef (const FName ControlName) |
| virtual BlueprintCallable bool | GetVirtualControlData (const FName ControlName, FVirtualControl &Data) |
| virtual BlueprintCallable void | AddVirtualInput (class UVirtualInput *VirtualInput, FVector2D LandscapePosition, FVector2D PortraitPosition) |
| virtual BlueprintCallable void | RemoveVirtualInput (class UVirtualInput *VirtualInput) |
| virtual BlueprintCallable void | ResetToDefault () |
| virtual BlueprintCallable void | SetVirtualControlAppearance (const FName ControlName, TArray< FVisualLayer > Layers) |
| virtual BlueprintPure void | GetVirtualControlLayer (const FName ControlName, const FName LayerName, FVisualLayer &OutLayer) |
| virtual BlueprintCallable void | SetVirtualControlLayer (const FName ControlName, const FVisualLayer &Layer) |
| virtual BlueprintCallable FName | AddNewLayer (const FName ControlName, const FName LayerName, FVisualLayer Layer) |
| virtual BlueprintCallable void | RemoveLayer (const FName ControlName, const FName LayerName) |
| virtual BlueprintCallable void | RemoveLayerAt (const FName ControlName, const int32 Index) |
| virtual BlueprintCallable bool | GetDynamicMaterialInstanceFromLayer (const FName ControlName, const FName LayerName, UMaterialInstanceDynamic *&DMI) |
| virtual BlueprintCallable void | ChangeButtonSize (const FName ControlName, const FVector2D NewVisualSize, const FVector2D NewInteractionSize) |
| virtual BlueprintCallable void | ChangeJoystickSize (const FName ControlName, const FVector2D NewVisualSize, const FVector2D NewThumbSize, const FVector2D NewInteractionSize) |
| virtual BlueprintCallable void | ChangeTouchRegionSize (const FName ControlName, const FVector2D NewInteractionSize) |
| virtual BlueprintCallable bool | ChangePosition (const FName ControlName, const FVector2D NewCenter, const bool LandscapePosition=true) |
| BlueprintCallable bool | TouchInterfaceExist () const |
| BlueprintCallable EControlType | GetTypeOfVirtualControl (const FName ControlName) const |
| virtual BlueprintCallable bool | ContainName (const FName ControlName) |
| virtual BlueprintCallable bool | GetAllControlsName (TArray< FName > &Names) |
| virtual BlueprintCallable bool | GetLayerNames (const FName ControlName, TArray< FName > &Names) |
| BlueprintCallable bool | IsInterfaceActive () const |
| BlueprintCallable bool | IsVisible () const |
| BlueprintCallable void | SetScaleMultiplier (const float NewScaleMultiplier) |
| virtual BlueprintPure bool | CanSave (const int32 SnapshotId, EFailReason &FailReason) |
| virtual BlueprintPure bool | TouchInterfaceSaveFileExist () |
| virtual BlueprintPure bool | TouchInterfaceConfigurationExist (const int32 ConfigIndex) |
| virtual BlueprintCallable bool | ConvertSaveDataByConfigIndex (const int32 UserIndex, const int32 ConfigIndex) |
| virtual BlueprintCallable bool | ConvertSaveData (const int32 UserIndex, UVirtualControlSetup *VirtualControlSetup, UTouchInterfaceLayout *TouchInterfaceLayout) |
| virtual BlueprintCallable bool | SaveConfigurationFromCurrentSetup (const int32 UserIndex, const int32 ConfigIndex) |
| virtual BlueprintCallable bool | SaveConfigurationWithSetup (const int32 UserIndex, const int32 ConfigIndex, UVirtualControlSetup *Setup) |
| virtual BlueprintCallable bool | Save (const int32 SnapshotID, UTouchInterfaceLayout *LayoutReference) |
| virtual BlueprintCallable bool | LoadConfiguration (const int32 UserIndex, const int32 ConfigIndex) |
| virtual BlueprintCallable bool | ApplySnapshot (const int32 SnapshotID) |
| virtual BlueprintPure bool | GetSnapshot (const int32 SnapshotID, FLayoutSaveData &Snapshot) |
| virtual BlueprintPure bool | GetConfiguration (const int32 UserIndex, const int32 ConfigIndex, FTouchInterfaceConfiguration &Configuration) |
| virtual BlueprintCallable bool | DeleteConfiguration (const int32 UserIndex, const int32 ConfigIndex) |
| virtual BlueprintCallable bool | DeleteSnapshot (const int32 SnapshotID) |
| virtual BlueprintCallable bool | DeleteTouchInterfaceSaveFile (const int32 UserIndex) |
| BlueprintCallable void | EnableDebug () const |
| BlueprintCallable void | DisableDebug () const |
Public Attributes | |
| Category ="Touch Interface" | |
| BlueprintCallable | |
| meta | |
| BlueprintPure | |
| BlueprintAssignable FOnStateChangedSignature | OnActiveStateChanged |
| BlueprintAssignable FOnStateChangedSignature | OnVisibilityStateChanged |
| BlueprintAssignable FOnSubsystemNotification | OnTouchInterfaceCreated |
| BlueprintAssignable FOnSubsystemNotification | OnTouchInterfaceRemoved |
| BlueprintAssignable FOnSubsystemNotification | OnGamepadConnected |
| BlueprintAssignable FOnSubsystemNotification | OnGamepadDisconnected |
This subsystem allows you to add and modify the touch interface. It also allows you to manage other components related to the touch interface.
| UTouchInterfaceSubsystem::UTouchInterfaceSubsystem | ( | ) |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
| UVirtualInputEvent * UTouchInterfaceSubsystem::CreateAndRegisterVirtualInputEvent | ( | TSubclassOf< UVirtualInputEvent > | Class | ) |
|
overridevirtual |
|
virtual |
|
virtual |
|
virtual |
| void UTouchInterfaceSubsystem::DisableDebug | ( | ) | const |
|
virtual |
|
virtual |
|
virtual |
| void UTouchInterfaceSubsystem::EnableDebug | ( | ) | const |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
| UVirtualShapeDrawer * UTouchInterfaceSubsystem::GetDrawerInstance | ( | ) | const |
|
virtual |
|
virtual |
|
inline |
|
virtual |
| const FGeometry & UTouchInterfaceSubsystem::GetTouchInterfaceGeometry | ( | ) | const |
| TSharedPtr< SDeprecatedTouchInterface > UTouchInterfaceSubsystem::GetTouchInterfaceInstance | ( | ) |
Return current touch interface. Warning! Can be null
| TSharedPtr< STouchInterfaceRuntime > UTouchInterfaceSubsystem::GetTouchInterfaceWidget | ( | ) |
Return current layout widget. Warning! Can be null
| EControlType UTouchInterfaceSubsystem::GetTypeOfVirtualControl | ( | const FName | ControlName | ) | const |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
| float UTouchInterfaceSubsystem::GetVirtualInputOpacity | ( | const FName | InputName | ) |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
overridevirtual |
| bool UTouchInterfaceSubsystem::IsInterfaceActive | ( | ) | const |
| bool UTouchInterfaceSubsystem::IsVisible | ( | ) | const |
|
virtual |
| bool UTouchInterfaceSubsystem::RegisterTouchListenerComponent | ( | UTouchInterfaceListener * | Listener | ) |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
| bool UTouchInterfaceSubsystem::SetInputAction | ( | const FName | ControlName, |
| UInputAction * | InputAction ) |
| void UTouchInterfaceSubsystem::SetScaleMultiplier | ( | const float | NewScaleMultiplier | ) |
|
virtual |
|
virtual |
| void UTouchInterfaceSubsystem::SetVirtualInputOpacity | ( | const FName | InputName, |
| const float | NewOpacity ) |
|
overridevirtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
| bool UTouchInterfaceSubsystem::TouchInterfaceExist | ( | ) | const |
|
virtual |
|
virtual |
| bool UTouchInterfaceSubsystem::UnregisterTouchListenerComponent | ( | UTouchInterfaceListener * | Listener | ) |
| UTouchInterfaceSubsystem::BlueprintCallable |
| UTouchInterfaceSubsystem::BlueprintPure |
| UTouchInterfaceSubsystem::Category ="Touch Interface" |
Unregister this component. This component will no longer receive input.
Create new touch interface (SWidget) If Layout is filled, create new touch interface with specified layout. Otherwise, create touch interface with empty layout If bLoadSave is true, all changes saved in snapshot will be applied. Change will be applied only if layout match layout reference in Snapshot
Hide touch interface
Launch Shape Recognition on all Shape Manager. This is a global call, you can call TryRecognizeShape on each Shape Manager. For now, DO NOT CALL this function until the user has finished drawing
Changes the Input Action of the virtual input. Primary use case is in Option Menu. Warning! It call Release before change
| ControlName | Name of control |
| InputAction | the desired input action |
Add virtual input to touch interface
| VirtualInput | Virtual input class to add |
| LandscapePosition | Position of virtual input in touch interface when in landscape orientation |
| PortraitPosition | Position of virtual input in touch interface when in portrait orientation |
Returns the first modifier with the specified class type Warning! Can be null Warning! Doesn't work in local multiplayer! Warning! Use with caution e.g. do not use every frame.
Return the first virtual input event with the specified class type Warning! Can be null Warning! Use with caution e.g. do not call this function every frame
Add new instance of virtual input event Return the instance of specified class type
Create and/or Get dynamic material instance associated with layer
| ControlName | Name of virtual control |
| LayerName | Name of layer |
| DMI | Dynamic Material instance that is created or recovered |
Set size of virtual control joystick. (VisualSize, thumb size and interaction size). Leave to zero has no change. Be careful when changing size of control when in use.
Set interaction size of virtual Touch Region. Leave to zero has no change.
Set position of control. Normalized to [0 to 1] negative value has no change Be careful when changing position of control when in use.
Return true if touch interface exist and was added to player screen
Return true if interface is in active state (the touch interface is being touched or has recently been touched)
Return true if interface is visible
Transform Local position (Touch Interface Geometry) to normalized (0 to 1)
| LocalPosition | LocalPosition in Touch Interface |
Transform normalized (0 to 1) to Local position (Touch Interface Geometry)
| NormalizedPosition | Normalized value (0 to 1) |
Transform Absolute position to Local position
| AbsolutePosition | Absolute Position in screen space |
Transform Local position in Absolute position
| LocalPosition | Position in layout geometry |
Return true if subsystem can save snapshot. Check if save game file exist and save game object can be created Check if snapshot ID is valid
Check if save game object exist in disk
Check if a configuration with specified config index exist in virtual control configuration save game object
| ConfigIndex | Index used to identify configuration |
Convert Virtual Control Setup data to Touch Interface Layout data Read configuration (virtual control setup) at index and write data to snapshot (touch interface layout) index
Convert Virtual Control Setup data to touch interface layout data Be careful, it's up to you to check if touch interface layout is equal to virtual control setup Read the first configuration that has virtual control setup as reference
Save current setup in configuration SaveGame Slot
| UserIndex | User Index used with configuration |
| ConfigIndex | Index used to identify configuration |
Save the current layout displayed on screen to disk. Position and size of components only.
| SnapshotID | Index used to identify snapshot |
| LayoutReference | Layout object from disk. It will be used as reference. Warning! Do not pass layout instance created by subsystem. |
Load configuration saved in SaveGame slot.
| UserIndex | User Index used with configuration |
| ConfigIndex | Index used for identify configuration |
Apply snapshot to existing touch interface.
| SnapshotID | Index used to identify snapshot |
Get snapshot from save file
Delete configuration saved in save game object
Delete snapshot saved in save game object
Delete save file from disk
Show useful data about component Debug not displayed in shipping build
Called when interface active state was changed Return true if interface is active (a control is currently hit)
Called when visibility state of interface was changed Return true if currently visible
| UTouchInterfaceSubsystem::meta |
| BlueprintAssignable FOnStateChangedSignature UTouchInterfaceSubsystem::OnActiveStateChanged |
| BlueprintAssignable FOnSubsystemNotification UTouchInterfaceSubsystem::OnGamepadConnected |
| BlueprintAssignable FOnSubsystemNotification UTouchInterfaceSubsystem::OnGamepadDisconnected |
| BlueprintAssignable FOnSubsystemNotification UTouchInterfaceSubsystem::OnTouchInterfaceCreated |
| BlueprintAssignable FOnSubsystemNotification UTouchInterfaceSubsystem::OnTouchInterfaceRemoved |
| BlueprintAssignable FOnStateChangedSignature UTouchInterfaceSubsystem::OnVisibilityStateChanged |