How-To Guides — Thunder.MonoGame.Avalonia

Practical guides for common tasks. Each guide is self-contained; start with 01 — Minimal Setup if you are new to the library.

Guides

# Guide What it covers
01 Minimal Setup NuGet install, project flags, XAML namespace, wiring the game control
02 Input Keyboard, mouse, and gamepad via standard MonoGame input APIs
03 Content Pipeline dotnet-mgcb, .mgcontent files, loading .xnb assets at runtime
04 Avalonia UI Overlay Layering Avalonia controls on top of the game surface (MVVM and code-behind)
05 SpriteBatch and 2D Rendering Textures, fonts, coloured rectangles, GraphicsDevice.Clear
06 Audio SoundEffect, SoundEffectInstance, looping music, headless fallback
07 Advanced Graphics BasicEffect, RenderTarget2D, AlphaTestEffect, OcclusionQuery, instanced draws
08 Multi-Screen and Sub-Viewports SubViewGameControl, DrawCallback, per-screen rendering, SuppressMainDraw
09 Multi-Window Multi-monitor patterns, VSync constraint, sub-viewports vs separate processes

Sample app

The sample project at samples/MonoGame.Framework.Avalonia.Sample/ has three tiers of increasing complexity:

Tier Files What it demonstrates
Minimal Minimal/MinimalGame.cs, Minimal/MinimalWindow.axaml Bare minimum: GraphicsDeviceManager, SpriteBatch, keyboard/mouse input
Overlay Overlay/OverlayGame.cs, Overlay/OverlayWindow.axaml Bouncing rect with an Avalonia pause button, MVVM binding
Advanced Advanced/SampleGame.*.cs, Advanced/MainWindow.axaml Full demo: SpriteBatch, BasicEffect cube, audio, gamepad, sub-viewports, multi-screen

See the sample README for running instructions.

latest ▼