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.TapGestureRecognizer Class Referencesealed

Recognizes single-finger tap gestures by listening to touch events from an ITouchInput source. A tap is defined as a touch that begins and ends within a configurable maximum duration and without exceeding a configurable maximum movement distance. Long presses and drags are ignored. More...

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

Public Member Functions

 TapGestureRecognizer (ITouchInput touchInput)
 Initializes a new instance of the TapGestureRecognizer 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 Tapped events will be raised.

Properties

double MaxTapDurationSeconds = 0.3 [get, set]
 Gets or sets the maximum duration in seconds that a touch may last to still be considered a tap. Contacts lasting longer than this threshold are treated as long presses and will not raise Tapped. Default is 0.3 seconds.
double MaxTapMovementPixels = 20 [get, set]
 Gets or sets the maximum distance in pixels that a touch may travel from its start position to still be considered a tap. Contacts that move more than this threshold are treated as drags and will not raise Tapped. Default is 20 pixels.

Events

EventHandler< TappedEventArgs >? Tapped
 Occurs when a qualifying single-finger tap gesture is detected.

Detailed Description

Recognizes single-finger tap gestures by listening to touch events from an ITouchInput source. A tap is defined as a touch that begins and ends within a configurable maximum duration and without exceeding a configurable maximum movement distance. Long presses and drags are ignored.

Subscribe to the Tapped event to receive notifications when a qualifying tap is detected.

A tap is recognized when:

Definition at line 24 of file TapGestureRecognizer.cs.

Constructor & Destructor Documentation

◆ TapGestureRecognizer()

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

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

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

Definition at line 66 of file TapGestureRecognizer.cs.

Member Function Documentation

◆ Dispose()

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

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

Definition at line 143 of file TapGestureRecognizer.cs.

Property Documentation

◆ MaxTapDurationSeconds

double Gondwana.Input.Touch.Gestures.TapGestureRecognizer.MaxTapDurationSeconds = 0.3
getset

Gets or sets the maximum duration in seconds that a touch may last to still be considered a tap. Contacts lasting longer than this threshold are treated as long presses and will not raise Tapped. Default is 0.3 seconds.

Definition at line 42 of file TapGestureRecognizer.cs.

◆ MaxTapMovementPixels

double Gondwana.Input.Touch.Gestures.TapGestureRecognizer.MaxTapMovementPixels = 20
getset

Gets or sets the maximum distance in pixels that a touch may travel from its start position to still be considered a tap. Contacts that move more than this threshold are treated as drags and will not raise Tapped. Default is 20 pixels.

Definition at line 49 of file TapGestureRecognizer.cs.

Event Documentation

◆ Tapped

EventHandler<TappedEventArgs>? Gondwana.Input.Touch.Gestures.TapGestureRecognizer.Tapped

Occurs when a qualifying single-finger tap gesture is detected.

Definition at line 54 of file TapGestureRecognizer.cs.