gum-runtime-systemmanagers-init

Documents the SystemManagers.Initialize() registration contract for implementing new Gum render backends.

614|78|Updated Mar 11, 2015
One-click install
npx skills add https://github.com/vchelaru/Gum --skill gum-runtime-systemmanagers-init
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gum-runtime-systemmanagers-init
Source: https://github.com/vchelaru/Gum/tree/main/.claude/skills/gum-runtime-systemmanagers-init
Command: npx skills add https://github.com/vchelaru/Gum --skill gum-runtime-systemmanagers-init

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Implementing a new render backend for Gum (e.g. Silk.NET) requires replicating a hand-written initialization sequence with no shared interface or base class to guide you, and mistakes silently degrade rendering instead of throwing errors.

Core Features & Use Cases

  • Registration Contract: Defines the five required steps every backend's Initialize() must perform, including ContentLoader wiring, CustomSetPropertyOnRenderable, CustomCreateGraphicalComponentFunc, StandardElementsManager initialization, and RegisterGueInstantiation for the 8 standard shape types.
  • Reference Implementations: Points to concrete file and line references in the MonoGame, Raylib, Skia, and Sokol backends to copy from.
  • Landmine Documentation: Explains silent fallback to FallbackRenderableFactory when a shape registration is missing, process-wide static assignment hazards, extended shape wiring via CustomGetDefaultState, and idempotency guard differences.
  • Use Case: When porting Gum to a new graphics backend, follow this contract to ensure all standard elements render with the backend's preferred renderables rather than degraded fallbacks.

Quick Start

Explain the SystemManagers.Initialize() registration steps I must implement to add a new render backend to Gum.

Frequently Asked Questions about gum-runtime-systemmanagers-init

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a new render backend for Gum UI?

Implement a SystemManagers.Initialize() that assigns LoaderManager.Self.ContentLoader, sets GraphicalUiElement.SetPropertyOnRenderable, provides a CustomCreateGraphicalComponentFunc factory, calls StandardElementsManager.Self.Initialize(), and registers the 8 standard shape types via RegisterGueInstantiation.

What shape types must a Gum backend register?

A conforming backend must register 8 standard shape types via ElementSaveExtensions.RegisterGueInstantiation: Circle, ColoredRectangle, Container, NineSlice, Polygon, Rectangle, Sprite, and Text. This is the primary registry Gum uses to build the GraphicalUiElement visual tree.

Why does my Gum backend render shapes differently than expected?

A missing RegisterGueInstantiation call does not throw; Gum silently falls back to FallbackRenderableFactory.TryHandleAsBaseType, which returns a plainer renderable such as an outline-only LineCircle. Register the real runtime wrapper instead of extending the fallback switch.

Can I run two Gum render backends in the same process?

No, not safely. The registration points like CustomCreateGraphicalComponentFunc and LoaderManager.Self.ContentLoader are process-wide statics, so the last Initialize() call wins and overwrites the other backend's wiring.

How do I add custom shape types beyond the standard 8 in Gum?

Extended shapes like Arc, ColoredCircle, or RoundedRectangle need their own RegisterGueInstantiation calls plus a StandardElementsManager.Self.CustomGetDefaultState assignment to supply default states, as demonstrated in the Skia backend.