Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
Gondwana.Input.Touch.Gestures.SwipeGestureRecognizer Class Referencesealed

Recognizes swipe gestures by listening to touch events from an ITouchInput source. A swipe is a single-finger gesture that ends with sufficient speed and with a clear primary direction. Short or slow drags do not qualify. More...

Inheritance diagram for Gondwana.Input.Touch.Gestures.SwipeGestureRecognizer:

Public Member Functions

 SwipeGestureRecognizer (ITouchInput touchInput)
 Initializes a new instance of the SwipeGestureRecognizer class, subscribing to touch events from the specified ITouchInput source.
void Dispose ()
 Releases all resources held by this recognizer and unsubscribes from the touch input source. After disposal, no further Swiped events will be raised.

Properties

double MinimumSwipeSpeedPixelsPerSecond = 200 [get, set]
 Gets or sets the minimum average speed, in pixels per second, that a touch must reach when it ends in order to be recognized as a swipe. Slower contacts are not recognized. Default is 200 pixels per second.
double MinimumSwipeDistancePixels = 30 [get, set]
 Gets or sets the minimum straight-line travel distance required for a swipe. This prevents a short, fast tap from also being recognized as a swipe. Default is 30 pixels.

Events

EventHandler< SwipedEventArgs >? Swiped
 Occurs when a qualifying swipe gesture is detected.

Detailed Description

Recognizes swipe gestures by listening to touch events from an ITouchInput source. A swipe is a single-finger gesture that ends with sufficient speed and with a clear primary direction. Short or slow drags do not qualify.

Subscribe to the Swiped event to receive notifications when a qualifying swipe is detected.

A swipe is recognized when a touch contact ends and the average speed over the contact duration meets or exceeds MinimumSwipeSpeedPixelsPerSecond.

Definition at line 20 of file SwipeGestureRecognizer.cs.

Constructor & Destructor Documentation

◆ SwipeGestureRecognizer()

Gondwana.Input.Touch.Gestures.SwipeGestureRecognizer.SwipeGestureRecognizer ( ITouchInput touchInput)

Initializes a new instance of the SwipeGestureRecognizer class, subscribing to touch events from the specified ITouchInput source.

Parameters
touchInputThe touch input source to monitor for swipe gestures. Must not be null.
Exceptions
ArgumentNullExceptionThrown when touchInput is null.

Definition at line 57 of file SwipeGestureRecognizer.cs.

Member Function Documentation

◆ Dispose()

void Gondwana.Input.Touch.Gestures.SwipeGestureRecognizer.Dispose ( )

Releases all resources held by this recognizer and unsubscribes from the touch input source. After disposal, no further Swiped events will be raised.

Definition at line 126 of file SwipeGestureRecognizer.cs.

Property Documentation

◆ MinimumSwipeDistancePixels

double Gondwana.Input.Touch.Gestures.SwipeGestureRecognizer.MinimumSwipeDistancePixels = 30
getset

Gets or sets the minimum straight-line travel distance required for a swipe. This prevents a short, fast tap from also being recognized as a swipe. Default is 30 pixels.

Definition at line 40 of file SwipeGestureRecognizer.cs.

◆ MinimumSwipeSpeedPixelsPerSecond

double Gondwana.Input.Touch.Gestures.SwipeGestureRecognizer.MinimumSwipeSpeedPixelsPerSecond = 200
getset

Gets or sets the minimum average speed, in pixels per second, that a touch must reach when it ends in order to be recognized as a swipe. Slower contacts are not recognized. Default is 200 pixels per second.

Definition at line 33 of file SwipeGestureRecognizer.cs.

Event Documentation

◆ Swiped

EventHandler<SwipedEventArgs>? Gondwana.Input.Touch.Gestures.SwipeGestureRecognizer.Swiped

Occurs when a qualifying swipe gesture is detected.

Definition at line 45 of file SwipeGestureRecognizer.cs.