Doprez.Stride.Avalonia 1.0.14

There is a newer version of this package available.
See the version list below for details.
dotnet add package Doprez.Stride.Avalonia --version 1.0.14
                    
NuGet\Install-Package Doprez.Stride.Avalonia -Version 1.0.14
                    
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="Doprez.Stride.Avalonia" Version="1.0.14" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Doprez.Stride.Avalonia" Version="1.0.14" />
                    
Directory.Packages.props
<PackageReference Include="Doprez.Stride.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 Doprez.Stride.Avalonia --version 1.0.14
                    
#r "nuget: Doprez.Stride.Avalonia, 1.0.14"
                    
#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 Doprez.Stride.Avalonia@1.0.14
                    
#: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=Doprez.Stride.Avalonia&version=1.0.14
                    
Install as a Cake Addin
#tool nuget:?package=Doprez.Stride.Avalonia&version=1.0.14
                    
Install as a Cake Tool

Stride.Avalonia

Core bridge library that enables rendering Avalonia UI controls inside the Stride 3D game engine. This is the foundational package — all other packages in this repository depend on it.

How It Works

  1. Headless AvaloniaAvaloniaApp.EnsureInitialized<T>() boots Avalonia's headless platform with Skia rendering (no native window). Your AvaloniaApp subclass configures themes and styles.
  2. Offscreen pagesAvaloniaPage creates a headless Window, manages frame capture with dirty-tracking, and provides the raw pixel data. Uses reflection to access HeadlessWindowImpl._lastRenderedFrame directly, avoiding LOH allocations from CaptureRenderedFrame().
  3. Entity integrationAvaloniaComponent is a Stride EntityComponent that attaches an Avalonia page to an entity. Supports fullscreen overlays and world-space 3D panels.
  4. Game systemAvaloniaSystem runs every frame during the Update phase, collecting all AvaloniaComponent instances, forwarding Stride input to Avalonia, and pumping the Avalonia dispatcher.
  5. RenderingAvaloniaSceneRenderer captures each component's Avalonia frame, uploads pixel data to GPU textures, and draws via SpriteBatch (fullscreen) or Sprite3DBatch (world-space).

Features

Rendering Modes

  • Fullscreen overlays — auto-resize to the back buffer; drawn as screen-space sprites
  • World-space 3D panels — configurable resolution, world size, billboarding, and AABB-based frustum culling
  • Depth-sorted rendering — back-to-front ordering for correct alpha blending

Input Forwarding

  • Mouse — move, button press/release, scroll wheel, with position deduplication during camera rotation
  • Keyboard — key press/release with full modifier support (Shift, Ctrl, Alt)
  • Text inputTextInput events forwarded for text field editing
  • 3D ray-casting — mouse interaction with world-space panels via ray-cast hit testing
  • Smart input skipping — input forwarding is skipped when mouse buttons are held (e.g., during camera rotation)

Texture Atlas System

  • Shelf-based texture packer — multiple world-space panels packed into shared atlas textures
  • Auto-growth — starts at 1024x1024, grows up to 4096x4096 by doubling and GPU CopyRegion
  • Batched draw calls — one draw call per atlas instead of one per panel
  • Managed via AvaloniaTextureAtlasManager — handles multiple atlases with O(1) reverse lookup

Performance

  • Zero-allocation input bridgeAvaloniaInputBridge uses compiled expression delegates to call PlatformImpl.Input directly, bypassing HeadlessWindowExtensions which runs jobs 20x per event
  • Direct framebuffer access — reflection-based shortcut avoids LOH allocations
  • Dirty-update throttlingMaxDirtyUpdatesPerFrame on AvaloniaSceneRenderer limits GPU texture uploads per frame

Profiling

  • AvaloniaRenderMetrics — singleton tracking per-phase timings (update, input, dispatcher, draw, capture, upload, sprite batch), panel counts, bytes uploaded, GC pressure, and rolling 120-frame history
  • AvaloniaProfilingKeys — integration with Stride's built-in profiler overlay
  • DebugPanel — ready-to-use Avalonia UserControl displaying FPS, frame time, entity count, draw calls, triangles, memory, uptime, and detailed per-phase Avalonia metrics

Key Classes

Class Description
AvaloniaApp Minimal Application subclass; call EnsureInitialized<T>() to boot headless Avalonia
AvaloniaPage Abstract base for offscreen UI pages with dirty-tracking and frame capture
DefaultAvaloniaPage Convenience wrapper that hosts any existing Avalonia Control
AvaloniaComponent Stride EntityComponent — attach to an entity to display Avalonia UI
AvaloniaSystem GameSystemBase — input forwarding and dispatcher pumping
AvaloniaSceneRenderer SceneRendererBase — frame capture, GPU upload, and sprite drawing
AvaloniaInputBridge Low-level input injection into headless Avalonia windows
AvaloniaInputMapper Stride-to-Avalonia key/mouse/modifier mapping
AvaloniaTextureAtlas Shelf-based GPU texture packer
AvaloniaTextureAtlasManager Multi-atlas manager with reverse lookup
AvaloniaRenderMetrics Performance metrics singleton
DebugPanel Built-in debug overlay control

Dependencies

Package Version
Avalonia 11.3.*
Avalonia.Desktop 11.3.*
Avalonia.Headless 11.3.*
Stride.Engine 4.3.0.2507

Target Framework

net10.0 (cross-platform)

Usage

See the root README for setup instructions and code examples.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.19 94 7/5/2026
1.0.15 117 6/13/2026
1.0.14 191 2/19/2026
1.0.6 114 2/19/2026
1.0.5 118 2/18/2026
1.0.3 120 2/17/2026
1.0.0 119 2/17/2026