Core
Focused documentation for Squander's framework-independent runtime APIs. Each page in this section pairs a use case with a minimum viable code sample, public type details, and a focused live example.
Available guides
- Text drawing — load a bundled font, prepare glyphs, and render changing labels with WebGPU.
- Input routing — route raw keyboard, pointer, and gamepad input through active scenes and global fallbacks.
- Asset loading — Load textures and fonts through the game-owned asset cache.
- Dynamic assets — Turn Blob and File values into GPU textures at runtime.
- Sprite drawing — Place textures and atlas regions with explicit transforms, tint, opacity, and draw order.
- Shape drawing — Draw rectangles, circles, lines, and outlines as frame-local commands.
- Paths and polygons — Build reusable polygon fills and curved stroke geometry from copied input data.
- 2D cameras — Transform world-space drawing with synchronous position, zoom, and rotation scopes.
- Viewport sizing — Keep logical coordinates stable as CSS size, letterboxing, and device pixels change.
- Texture filtering — Choose nearest or linear sampling for each texture.
- Game lifecycle — Start, pause, resume, suspend, and dispose an isolated game instance.
- Game timing — Drive deterministic update and draw loops with bounded deltas.
- WebGPU runtime — Create a secure-context WebGPU renderer and draw deterministic frames.
- Resource ownership — Keep GPU resources alive across accepted draws with opaque handles and leases.
- Svelte 5 bridge — Connect game state and typed commands to Svelte without coupling core to Svelte.
Documentation contract
A core feature guide should link from this sidebar section, teach one use case, show its result in a focused live example, explain its supported and deferred behavior, show the public types, and include a code sample that can be adapted into a game. Tests remain repository evidence, not visitor-facing proof.