Gondwana.Avalonia 2.3.0

dotnet add package Gondwana.Avalonia --version 2.3.0
                    
NuGet\Install-Package Gondwana.Avalonia -Version 2.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Gondwana.Avalonia" Version="2.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Gondwana.Avalonia" Version="2.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Gondwana.Avalonia" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Gondwana.Avalonia --version 2.3.0
                    
#r "nuget: Gondwana.Avalonia, 2.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Gondwana.Avalonia@2.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Gondwana.Avalonia&version=2.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Gondwana.Avalonia&version=2.3.0
                    
Install as a Cake Tool

Gondwana.Avalonia

Gondwana.Avalonia provides Avalonia UI adapters for rendering and input, mirroring Gondwana.WinForms but targeting all platforms supported by Avalonia: desktop (Windows, Linux, macOS), WebAssembly, Android, and iOS / macOS (Catalyst).

Features

  • Bitmap rendering surface using Avalonia WriteableBitmap (no platform-specific SkiaSharp view package required; works on all Avalonia targets)
  • Keyboard input integration (global key capture via Avalonia TopLevel)
  • Mouse / pointer input integration
  • Touch input integration with gesture recognizer support (TapGestureRecognizer, SwipeGestureRecognizer, PinchGestureRecognizer)
  • Designed to be consumed by platform-specific Avalonia host projects

Installation

dotnet add package Gondwana.Avalonia

Usage

Register Avalonia adapters during application startup (inside your Window.OnOpened or similar):

Engine.Instance.InitializeAvaloniaKeyboardAdapter(myWindow);
Engine.Instance.InitializeAvaloniaMouseAdapter(renderSurfaceControl);

Touch input

Enable touch / gesture input by calling InitializeAvaloniaTouchAdapter with the control that should receive pointer events:

Engine.Instance.InitializeAvaloniaTouchAdapter(renderSurfaceControl);

After initialization, the touch system is accessible via engine.Input.TouchEventPoller:

// Raw touch events
Engine.Instance.Input.TouchEventPoller!.TouchBegan += (_, e) =>
    Console.WriteLine($"Touch began: id={e.Touch.Id} pos={e.Touch.Position}");

// Active contacts (polling)
var touches = Engine.Instance.Input.TouchEventPoller!.ActiveTouches;
Gesture recognizers

Gesture recognizers are standalone classes in Gondwana.Input.Touch.Gestures that subscribe to an ITouchInput source and raise higher-level events. Dispose them when no longer needed.

using Gondwana.Input.Touch.Gestures;

var tap = new TapGestureRecognizer(Engine.Instance.Input.TouchEventPoller!)
{
    MaxTapDurationSeconds = 0.3,   // default
    MaxTapMovementPixels  = 20,    // default
};
tap.Tapped += (_, e) => Console.WriteLine($"Tapped at {e.Position}");

var swipe = new SwipeGestureRecognizer(Engine.Instance.Input.TouchEventPoller!)
{
    MinimumSwipeSpeedPixelsPerSecond = 200,  // default
};
swipe.Swiped += (_, e) => Console.WriteLine($"Swiped {e.Direction} at {e.SpeedPixelsPerSecond:F0} px/s");

var pinch = new PinchGestureRecognizer(Engine.Instance.Input.TouchEventPoller!);
pinch.PinchUpdated += (_, e) => Console.WriteLine($"Pinch scale delta: {e.ScaleDelta:F3}");

Desktop note: On desktop platforms without a hardware touch screen, the mouse pointer is automatically emulated as a single touch contact (Id = 0). Existing mouse input is unaffected.

Key codes

AvaloniaKeyboardAdapter uses (int)Avalonia.Input.Key values as key codes. Use AvaloniaKeyboardAdapter.GetKeyCodeFromString("Left") to resolve a key name at runtime.

Documentation

  • Gondwana – Core engine
  • Gondwana.Avalonia.Hosting – Avalonia game host

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Gondwana.Avalonia:

Package Downloads
Gondwana.Avalonia.Hosting

Avalonia hosting implementation for the Gondwana Game Engine, providing an Avalonia-specific game host for application startup, lifecycle management, and adapter integration across desktop, WASM, Android, iOS, and macOS.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.3.0 151 5/19/2026
2.2.4 292 5/9/2026
2.2.3 191 5/5/2026
2.2.2 109 5/3/2026
2.2.0 139 4/29/2026