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

Provides data for the TouchEventPoller.TouchEvent, carrying the details of a recognized gesture. Check IsTap, IsSwipe, or IsPinch to determine which kind of gesture occurred, then access the corresponding nullable property (Tap, Swipe, or Pinch) for the specific data. More...

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

Public Member Functions

 GestureEventArgs (TappedEventArgs tap)
 Initializes a new GestureEventArgs for a tap gesture.
 GestureEventArgs (SwipedEventArgs swipe)
 Initializes a new GestureEventArgs for a swipe gesture.
 GestureEventArgs (PinchedEventArgs pinch)
 Initializes a new GestureEventArgs for a pinch gesture.

Properties

GestureType GestureType [get]
 Gets the type of gesture that this event represents. Use IsTap, IsSwipe, or IsPinch as convenient boolean shorthands, or switch on this value for exhaustive handling.
TappedEventArgs? Tap [get]
 Gets data specific to a tap gesture, or null when GestureType is not GestureType.Tap.
SwipedEventArgs? Swipe [get]
 Gets data specific to a swipe gesture, or null when GestureType is not GestureType.Swipe.
PinchedEventArgs? Pinch [get]
 Gets data specific to a pinch or spread gesture, or null when GestureType is not GestureType.Pinch.
bool IsTap [get]
 Gets a value indicating whether this event represents a tap gesture. When true, Tap is non-null.
bool IsSwipe [get]
 Gets a value indicating whether this event represents a swipe gesture. When true, Swipe is non-null.
bool IsPinch [get]
 Gets a value indicating whether this event represents a pinch or spread gesture. When true, Pinch is non-null.

Detailed Description

Provides data for the TouchEventPoller.TouchEvent, carrying the details of a recognized gesture. Check IsTap, IsSwipe, or IsPinch to determine which kind of gesture occurred, then access the corresponding nullable property (Tap, Swipe, or Pinch) for the specific data.

This follows the same pattern as MouseEventArgs: a single unified event type whose properties make it easy to filter and act on specific interaction kinds. For example:

engine.Input.TouchEventPoller.TouchEvent += e =>
{
if (e.IsTap) HandleTap(e.Tap!);
if (e.IsSwipe) HandleSwipe(e.Swipe!);
if (e.IsPinch) HandlePinch(e.Pinch!);
};

Definition at line 23 of file GestureEventArgs.cs.

Constructor & Destructor Documentation

◆ GestureEventArgs() [1/3]

Gondwana.Input.Touch.Gestures.GestureEventArgs.GestureEventArgs ( TappedEventArgs tap)

Initializes a new GestureEventArgs for a tap gesture.

Parameters
tapData describing the tap. Must not be null.

Definition at line 72 of file GestureEventArgs.cs.

◆ GestureEventArgs() [2/3]

Gondwana.Input.Touch.Gestures.GestureEventArgs.GestureEventArgs ( SwipedEventArgs swipe)

Initializes a new GestureEventArgs for a swipe gesture.

Parameters
swipeData describing the swipe. Must not be null.

Definition at line 82 of file GestureEventArgs.cs.

◆ GestureEventArgs() [3/3]

Gondwana.Input.Touch.Gestures.GestureEventArgs.GestureEventArgs ( PinchedEventArgs pinch)

Initializes a new GestureEventArgs for a pinch gesture.

Parameters
pinchData describing the pinch. Must not be null.

Definition at line 92 of file GestureEventArgs.cs.

Property Documentation

◆ GestureType

GestureType Gondwana.Input.Touch.Gestures.GestureEventArgs.GestureType
get

Gets the type of gesture that this event represents. Use IsTap, IsSwipe, or IsPinch as convenient boolean shorthands, or switch on this value for exhaustive handling.

Definition at line 30 of file GestureEventArgs.cs.

◆ IsPinch

bool Gondwana.Input.Touch.Gestures.GestureEventArgs.IsPinch
get

Gets a value indicating whether this event represents a pinch or spread gesture. When true, Pinch is non-null.

Definition at line 66 of file GestureEventArgs.cs.

◆ IsSwipe

bool Gondwana.Input.Touch.Gestures.GestureEventArgs.IsSwipe
get

Gets a value indicating whether this event represents a swipe gesture. When true, Swipe is non-null.

Definition at line 60 of file GestureEventArgs.cs.

◆ IsTap

bool Gondwana.Input.Touch.Gestures.GestureEventArgs.IsTap
get

Gets a value indicating whether this event represents a tap gesture. When true, Tap is non-null.

Definition at line 54 of file GestureEventArgs.cs.

◆ Pinch

PinchedEventArgs? Gondwana.Input.Touch.Gestures.GestureEventArgs.Pinch
get

Gets data specific to a pinch or spread gesture, or null when GestureType is not GestureType.Pinch.

Definition at line 48 of file GestureEventArgs.cs.

◆ Swipe

SwipedEventArgs? Gondwana.Input.Touch.Gestures.GestureEventArgs.Swipe
get

Gets data specific to a swipe gesture, or null when GestureType is not GestureType.Swipe.

Definition at line 42 of file GestureEventArgs.cs.

◆ Tap

TappedEventArgs? Gondwana.Input.Touch.Gestures.GestureEventArgs.Tap
get

Gets data specific to a tap gesture, or null when GestureType is not GestureType.Tap.

Definition at line 36 of file GestureEventArgs.cs.