Skip to content

Commit

Permalink
Use GDTIM-4.x-v2_1_2
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico-Ciuffardi committed May 2, 2023
1 parent 54b4f67 commit 5ac24a9
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 6 deletions.
File renamed without changes.
File renamed without changes.
26 changes: 21 additions & 5 deletions GDTIM-vgodot4support/README.md → GDTIM-4.x-v2_1_2/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
<img src="https://i.imgur.com/HxwBAK2.png" align="right" />

# Godot Touch Input Manager
Godot Touch Input Manager (GDTIM) is an asset that improves touch input support (includes [new gestures](#supported-gestures)) in the Godot game engine. You just need to autoload a script and it will start analyzing the touch input. When a gesture is detected a Custom Input Event corresponding to the detected gesture will be created and [fed up](https://docs.godotengine.org/en/stable/classes/class_input.html#class-input-method-parse-input-event) to the Godot built in Input Event system so it triggers functions like [`_input(InputEvent event)`](https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-input). There is also a signal for each gesture if you prefer using signals to the aforementioned.
Godot Touch Input Manager (GDTIM) is an asset that improves touch input support (includes [new gestures](#supported-gestures)) in the Godot game engine. You just need to autoload a script and it will start analyzing the touch input. When a gesture is detected a Custom Input Event corresponding to the detected gesture will be created and [fed up](https://docs.godotengine.org/en/stable/classes/class_input.html#class-input-method-parse-input-event) to the Godot built in Input Event system so it triggers functions like [`_input(InputEvent event)`](https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-input). There is also a signal for each gesture if you prefer using signals to the aforementioned.

This asset was ported to be added to Godot and is now a milestone for version 4.0 ([PR](https://github.com/godotengine/godot/pull/36953)).
There are two active PRs that add some GDTIM gestures as native Godot events, one for [version 3.x](https://github.com/godotengine/godot/pull/37754) and one for [version 4.x](https://github.com/godotengine/godot/pull/39055), if you are interested, please show your support there.

## Table of contents
* [How to use](#how-to-use)
* [Examples](#examples)
* [Documentation](#documentation)
* [FAQ](#faq)

## How to use
* Download the latest release from https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/releases
* Extract the downloaded *.zip* file somewhere in you project
* Locate the extracted `InputManager.gd`, and [Autoload](https://docs.godotengine.org/en/3.4/tutorials/scripting/singletons_autoload.html) it.
* Done! Now you can use the GodotTouchInputManager's [signals and its Custom Input Events](#supported-gestures).
* Done! Now you can use GDTIM [signals and Custom Input Events](#supported-gestures).

## Examples
### [GodotTouchInputManager-Demo](https://github.com/Federico-Ciuffardi/GodotTouchInputManager-Demo)
Expand Down Expand Up @@ -101,6 +107,18 @@ values on the script.
| LONG_PRESS_TIME_THRESHOLD | 0.75 | The fingers must press for `LONG_PRESS_TIME_THRESHOLD` seconds for [single-finger long press](#gestures-supported) and [multi-finger long press](#gestures-supported) gestures to be recognized. |
| LONG_PRESS_DISTANCE_LIMIT | 25.0 | The centroid of the finger presses must differ less than `LONG_PRESS_DISTANCE_LIMIT` pixels from the centroid of the fingers last positions for the [single finger long press](#supported-gestures) and [multiple finger long press](#supported-gestures) gestures to be recognized. |

## FAQ
### How can I get GDTIM to work when using control nodes?

By default, the control nodes consume events and therefore GDTIM cannot analyze them. To prevent this, set `Mouse>Filter` to `Ignore` on control nodes as needed.

![image](https://user-images.githubusercontent.com/45585143/235382152-1c99f7eb-eed3-4f96-b1b2-ba0a899d5225.png)

For more information see the [documentation](https://docs.godotengine.org/en/stable/classes/class_control.html#enum-control-mousefilter).

### GDTIM events don't trigger collisions, is there a way to fix it?

Custom input events do not trigger collisions, at the moment the solution is to manually check for collisions between shapes and events. For more information and ideas on how to do this see [this issue](https://github.com/Federico-Ciuffardi/GodotTouchInputManager/issues/16).

## Versioning
Using [SemVer](http://semver.org/) for versioning. For the versions available, see the [releases](https://github.com/Federico-Ciuffardi/Godot-Touch-Input-Manager/releases).
Expand All @@ -114,5 +132,3 @@ Feel free to append yourself here if you've made contributions.
Thank you for checking out this repository, you can send all your questions and comments to Federico.Ciuffardi@outlook.com.

If you are willing to contribute in any way, please contact me.


File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ config/features=PackedStringArray("4.0")

[autoload]

InputManager="*res://GDTIM-vgodot4support/InputManager.gd"
InputManager="*res://GDTIM-4.x-v2_1_2/InputManager.gd"

[debug]

Expand Down

0 comments on commit 5ac24a9

Please sign in to comment.