UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TouchInterface.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "SlateFwd.h"
8#include "UObject/Object.h"
9#include "InputCoreTypes.h"
10#include "TouchInterface.generated.h"
11
12class UTexture2D;
13
14USTRUCT()
16{
18
19 // basically mirroring SVirtualJoystick::FControlInfo but as an editable class
20 UPROPERTY(EditAnywhere, Category="Control", meta=(ToolTip="Set this to true to treat the joystick as a simple button"))
21 bool bTreatAsButton = false;
22 UPROPERTY(EditAnywhere, Category="Control", meta=(ToolTip="For sticks, this is the Thumb"))
24 UPROPERTY(EditAnywhere, Category="Control", meta=(ToolTip="For sticks, this is the Background"))
26 UPROPERTY(EditAnywhere, Category="Control", meta=(ToolTip="The initial center point of the control. If Time Until Reset is < 0, control resets back to here.\nUse negative numbers to invert positioning from top to bottom, left to right. (if <= 1.0, it's relative to screen, > 1.0 is absolute)"))
28 UPROPERTY(EditAnywhere, Category="Control", meta=(ToolTip="The size of the control (if <= 1.0, it's relative to screen, > 1.0 is absolute)"))
29 FVector2D VisualSize;
30 UPROPERTY(EditAnywhere, Category="Control", meta=(ToolTip="For sticks, the size of the thumb (if <= 1.0, it's relative to screen, > 1.0 is absolute)"))
31 FVector2D ThumbSize;
32 UPROPERTY(EditAnywhere, Category="Control", meta=(ToolTip="The interactive size of the control. Measured outward from Center. (if <= 1.0, it's relative to screen, > 1.0 is absolute)"))
33 FVector2D InteractionSize;
34 UPROPERTY(EditAnywhere, Category = "Control", meta = (ToolTip = "The scale for control input"))
35 FVector2D InputScale;
36 UPROPERTY(EditAnywhere, Category="Control", meta=(ToolTip="The main input to send from this control (for sticks, this is the horizontal axis)"))
37 FKey MainInputKey;
38 UPROPERTY(EditAnywhere, Category="Control", meta=(ToolTip="The alternate input to send from this control (for sticks, this is the vertical axis)"))
39 FKey AltInputKey;
40
42 : bTreatAsButton(false)
43 , Image1(nullptr)
44 , Image2(nullptr)
46 , VisualSize(ForceInitToZero)
47 , ThumbSize(ForceInitToZero)
48 , InteractionSize(ForceInitToZero)
49 , InputScale(1.f, 1.f)
50 {
51 }
52};
53
54
58UCLASS(Blueprintable, BlueprintType, MinimalAPI)
60{
62
63 UPROPERTY(EditAnywhere, Category="TouchInterface")
65
66 UPROPERTY(EditAnywhere, Category="TouchInterface", meta=(ToolTip="Opacity (0.0 - 1.0) of all controls while any control is active"))
67 float ActiveOpacity;
68
69 UPROPERTY(EditAnywhere, Category="TouchInterface", meta=(ToolTip="Opacity (0.0 - 1.0) of all controls while no controls are active"))
70 float InactiveOpacity;
71
72 UPROPERTY(EditAnywhere, Category="TouchInterface", meta=(ToolTip="How long after user interaction will all controls fade out to Inactive Opacity"))
73 float TimeUntilDeactive;
74
75 UPROPERTY(EditAnywhere, Category="TouchInterface", meta=(ToolTip="How long after going inactive will controls reset/recenter themselves (0.0 will disable this feature)"))
76 float TimeUntilReset;
77
78 UPROPERTY(EditAnywhere, Category="TouchInterface", meta=(ToolTip="How long after joystick enabled for touch (0.0 will disable this feature)"))
79 float ActivationDelay;
80
81 UPROPERTY(EditAnywhere, Category="TouchInterface", meta=(ToolTip="Prevent joystick re-centering and moving from Center through user taps"))
82 bool bPreventRecenter;
83
84 UPROPERTY(EditAnywhere, Category = "TouchInterface", meta = (ToolTip = "Delay at startup before virtual joystick is drawn"))
85 float StartupDelay;
86
88 ENGINE_API virtual void Activate(TSharedPtr<SVirtualJoystick> VirtualJoystick);
89};
@ ForceInitToZero
Definition CoreMiscDefines.h:156
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
bool left(const int *a, const int *b, const int *c)
Definition RecastMesh.cpp:182
if(Failed) console_printf("Failed.\n")
Definition Array.h:670
Definition SharedPointer.h:692
Definition Object.h:95
Definition Texture2D.h:26
Definition TouchInterface.h:60
@ false
Definition radaudio_common.h:23
int main()
Definition radaudio_mdct_build_tables.cpp:83
Definition InputCoreTypes.h:50
Definition TouchInterface.h:16
Definition ObjectPtr.h:488