SpawnDev.GameUI

GPU-rendered game UI for Blazor WebAssembly: PC, VR, AR and mobile.

License: MITnet10.0

SpawnDev.GameUI is a game UI library for Blazor WebAssembly in which all UI is rendered by WebGPU, with no HTML overlays on the canvas. It supports PC, VR, AR and mobile through one input abstraction. The README states it is used in production by SpawnScene and Lost Spawns.

Runs on

WebGPUBlazor WebAssemblyWebXR (VR/AR)

Highlights

  • 40+ UI elements: panels, labels, buttons, sliders, toggles, text input, scroll views, lists, dropdowns, radial menus, tooltips, color pickers, plus game HUD widgets (hotbar, status bars, minimap, compass, crosshair).
  • Unified input: mouse, keyboard, gamepad, VR controllers, hand tracking, touch and gaze through one GameInput abstraction.
  • Four render modes: screen-space 2D, world-space 3D, view-anchored VR HUD and world-anchored AR.
  • SDF font rendering with bitmap fallback and outline support; batched quad renderer (4096 quads per frame).
  • Six themes (Dark, LostSpawns, AubsCraft, HighContrast, ColorblindSafe, TritanopiaSafe) with runtime font scale.
  • Click routing so only the topmost element under a pointer gets the click; tween animation with 10 easing functions; screen stack, focus navigation and drag-and-drop.
Program.cs
// Create the UI tree
var root = new UIAnchorPanel { Width = viewportW, Height = viewportH };

// Add a health bar (bottom-left)
var healthBar = new UIProgressBar
{
    Width = 200, Height = 20,
    Value = 0.75f,
    LowColor = Color.Orange,
    CriticalColor = Color.Red,
    ShowPercentage = true,
    Label = "HP",
};
root.AddAnchored(healthBar, Anchor.BottomLeft, offsetX: 20, offsetY: -40);

// Add a settings panel
var settings = new UIFlexPanel { Direction = FlexDirection.Column, Gap = 8 };
settings.AddChild(new UILabel { Text = "Settings", FontSize = FontSize.Heading });
settings.AddChild(new UIToggle { Text = "VSync", IsOn = true });
settings.AddChild(new UISlider { Label = "FOV", MinValue = 60, MaxValue = 120, Value = 90 });
root.AddAnchored(settings, Anchor.TopRight, offsetX: -20, offsetY: 20);

// Per frame:
gameInput.Poll();
TweenManager.Global.Update(dt);
root.Update(gameInput, dt);

renderer.Begin(viewportW, viewportH);
root.Draw(renderer);
renderer.End(encoder, targetView);

Install

dotnet add package SpawnDev.GameUI

Building on SpawnDev.GameUI?

Private tickets, response targets and a direct line to the engineer who wrote it.

See support plans
An unhandled error has occurred. Reload x