![]() |
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.
|
Provides a passive touch/pointer state adapter for Avalonia applications, implementing ITouchAdapter by translating Avalonia PointerPressed, PointerMoved, PointerReleased, and PointerCaptureLost events into Gondwana touch state. Events are not raised directly; the TouchEventPoller polls this adapter each engine frame to detect transitions and raise events.
More...
Public Member Functions | |
| AvaloniaTouchInputAdapter (Control control, bool emulateMouse=false) | |
| Initializes a new instance of the AvaloniaTouchInputAdapter class, attaching pointer event handlers to the specified Avalonia control. | |
| IReadOnlyList< TouchPoint > | ConsumeBeganTouches () |
Drains and returns all touch contacts that began since the last call. Keeping beginnings in a queue prevents a short tap that begins and ends between two engine polls from being lost. Adapters that do not maintain a beginning queue may rely on the default empty implementation; the poller will still discover active contacts from ActiveTouches.
| |
| IReadOnlyList< TouchPoint > | ConsumeEndedTouches () |
Drains and returns all touch contacts that ended (lifted or cancelled) since the last call. Each entry preserves the original TouchPhase (TouchPhase.Ended or TouchPhase.Cancelled) so the poller can distinguish between the two. This method is intended to be called once per engine tick by the TouchEventPoller.
| |
| void | Dispose () |
| Releases all resources held by this adapter, unsubscribing from all Avalonia pointer events. After disposal, no further touch events will be raised. | |
Properties | |
| IReadOnlyList< TouchPoint > | ActiveTouches [get] |
| Gets the list of touch contact points that are currently active (in contact with the surface). This list reflects the state at the most recent platform pointer event. An empty list indicates no fingers are currently in contact. | |
Provides a passive touch/pointer state adapter for Avalonia applications, implementing ITouchAdapter by translating Avalonia PointerPressed, PointerMoved, PointerReleased, and PointerCaptureLost events into Gondwana touch state. Events are not raised directly; the TouchEventPoller polls this adapter each engine frame to detect transitions and raise events.
On physical touch devices (Android, iOS), each finger contact is tracked by Avalonia's pointer ID and exposed as a unique TouchPoint. Mouse pointers are ignored by default so an application that also initializes AvaloniaMouseAdapter does not receive duplicate mouse and touch input. Pass emulateMouse: true to the constructor when single-contact mouse emulation is desired.
Dispose this adapter to unsubscribe from all Avalonia pointer events.
Definition at line 28 of file AvaloniaTouchInputAdapter.cs.
| Gondwana.Avalonia.Input.Touch.AvaloniaTouchInputAdapter.AvaloniaTouchInputAdapter | ( | Control | control, |
| bool | emulateMouse = false ) |
Initializes a new instance of the AvaloniaTouchInputAdapter class, attaching pointer event handlers to the specified Avalonia control.
| control | The Avalonia Control whose pointer events will be translated into touch events. Must not be null. |
| emulateMouse | When true, primary mouse-button input is also exposed as touch ID 0. The default is false to keep mouse and physical touch distinct. |
| ArgumentNullException | Thrown when control is null. |
Definition at line 56 of file AvaloniaTouchInputAdapter.cs.
| IReadOnlyList< TouchPoint > Gondwana.Avalonia.Input.Touch.AvaloniaTouchInputAdapter.ConsumeBeganTouches | ( | ) |
Drains and returns all touch contacts that began since the last call. Keeping beginnings in a queue prevents a short tap that begins and ends between two engine polls from being lost. Adapters that do not maintain a beginning queue may rely on the default empty implementation; the poller will still discover active contacts from ActiveTouches.
Implements Gondwana.Input.Touch.ITouchAdapter.
Definition at line 144 of file AvaloniaTouchInputAdapter.cs.
| IReadOnlyList< TouchPoint > Gondwana.Avalonia.Input.Touch.AvaloniaTouchInputAdapter.ConsumeEndedTouches | ( | ) |
Drains and returns all touch contacts that ended (lifted or cancelled) since the last call. Each entry preserves the original TouchPhase (TouchPhase.Ended or TouchPhase.Cancelled) so the poller can distinguish between the two. This method is intended to be called once per engine tick by the TouchEventPoller.
Implements Gondwana.Input.Touch.ITouchAdapter.
Definition at line 156 of file AvaloniaTouchInputAdapter.cs.
| void Gondwana.Avalonia.Input.Touch.AvaloniaTouchInputAdapter.Dispose | ( | ) |
Releases all resources held by this adapter, unsubscribing from all Avalonia pointer events. After disposal, no further touch events will be raised.
Definition at line 192 of file AvaloniaTouchInputAdapter.cs.
|
get |
Gets the list of touch contact points that are currently active (in contact with the surface). This list reflects the state at the most recent platform pointer event. An empty list indicates no fingers are currently in contact.
Implements Gondwana.Input.Touch.ITouchAdapter.
Definition at line 39 of file AvaloniaTouchInputAdapter.cs.