Skip to content

Commit 0ef5921

Browse files
committed
Updated README.md
1 parent 476d43b commit 0ef5921

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed
269 KB
Loading

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Godot Input Event Gesture Handler (C#)
22

3+
<img src="Media/godot-csharp-input-event-gesture-handler.jpg" alt="Godot Input Event Gesture Handler Thumbnail"/>
4+
35
A comprehensive solution for handling touch and gesture inputs in Godot Engine using C#. The `InputEventGestureHandler` class provides high-level gesture detection and emits events for various touch gestures such as taps, swipes, pinches, twists, and more.
46

57
## Table of Contents
@@ -87,11 +89,29 @@ The `InputEventGestureHandler` emits the following C# events:
8789
The `InputEventGestureHandler` includes configurable constants to adjust gesture detection sensitivity and thresholds:
8890

8991
```csharp
92+
private const bool DEFAULT_BINDINGS = true;
93+
private const bool DEBUG = false;
94+
95+
// Time threshold to consider a drag gesture.
96+
private const float DRAG_STARTUP_TIME = 0.02f;
97+
98+
// Finger size used to define thresholds in gesture calculations.
99+
private const float FINGER_SIZE = 100.0f;
100+
101+
// Time threshold to detect multi-finger release gestures.
102+
private const float MULTI_FINGER_RELEASE_THRESHOLD = 0.1f;
103+
104+
// Time and distance thresholds for detecting tap gestures.
90105
private const float TAP_TIME_LIMIT = 0.2f;
91106
private const float TAP_DISTANCE_LIMIT = 25.0f;
107+
108+
// Time and distance limits for detecting long press gestures.
109+
private const float LONG_PRESS_TIME_THRESHOLD = 0.75f;
110+
private const float LONG_PRESS_DISTANCE_LIMIT = 25.0f;
111+
112+
// Time and distance thresholds for detecting swipe gestures.
92113
private const float SWIPE_TIME_LIMIT = 0.5f;
93114
private const float SWIPE_DISTANCE_THRESHOLD = 200.0f;
94-
// ... Other configuration constants
95115
```
96116

97117
Adjust these values as needed for your game's input requirements.
@@ -105,6 +125,7 @@ Adjust these values as needed for your game's input requirements.
105125
```csharp
106126
public partial class PlayerController : Node
107127
{
128+
108129
...
109130

110131
public override void _Ready()
@@ -123,6 +144,9 @@ public partial class PlayerController : Node
123144
{
124145
...
125146
}
147+
148+
...
149+
126150
}
127151
```
128152

0 commit comments

Comments
 (0)