Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
Swipe Event Class.This asset provides a new Class node "SwipeEventModule" meant to generate "InputEventSwipe" event, who is not provided by the engine.https://github.com/burstina/SwipeEvent
SwipeEvent
Swipe Event Module for Godot Engine
Property | Description |
---|---|
Swipe Time Max | Time limit to detect if the gesture is a swipe or a drag |
Tollerance | Time tollerance between frames to adjust swipe detection |
Bound to Parent | If TRUE, detection will affect only parent node. That means: event.get_target() = parent_node NOTE:It has to ba any Control node to run smoothly. (if parent is not a Control node, you have to call Activate() and Deactivate() by yourself |
Cumulative Drag | (Pretty experimental) If detection engine doesn't detect a swipe, only a single cumulative drag event has to be trasmitted |
Drag while Swipe | Doesn't suppress Drag events while the engine are trying to detect swipes |
Call deferred | If TRUE, swipe engine submits events as deferred calls |
InputEventSwipe
Event generated by SwipeEvent core module.
Type | Function Name | Description |
---|---|---|
Vector2 | get_direction() | Real swipe direction. x and y are always fully loaded with values |
Vector2 | get_speed() | Computed swipe speed, in points per second |
Node | get_target() | if Bound to Parent is true, it returns parent node, otherwise returns null |
bool | left() | Returns TRUE if swipe direction is heading left |
bool | right() | Returns TRUE if swipe direction is heading right |
bool | up() | Returns TRUE if swipe direction is heading up |
bool | down() | Returns TRUE if swipe direction is heading down |
Followind example shows how to check SwipeEvent in parent (Control) node:
SceneTree build example SwipeEventDemo
Followind example shows how to use SwipeModule in scene tree. This picture shows three TextureRect nodes, each one with its own SwipeModule node, bacause we want all three TextureRect to be swiped.
Swipe Event Class.
This asset provides a new Class node "SwipeEventModule" meant to generate "InputEventSwipe" event, who is not provided by the engine.
https://github.com/burstina/SwipeEvent
Reviews
Quick Information
Swipe Event Class.This asset provides a new Class node "SwipeEventModule" meant to generate "InputEventSwipe" event, who is not provided by the engine.https://github.com/burstina/SwipeEvent