Skip to content
Back to skills

Gum Runtime Systemmanagers Init

ASecurity

The SystemManagers.Initialize() registration contract every render backend must fulfill. Triggers: new backend implementer, CustomCreateGraphicalComponentFunc, RegisterGueInstantiation, StandardElementsManager.Initialize, LoaderManager.Self.ContentLoader, FallbackRenderableFactory.

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 7, 2026
designgoawsbackend

Security analysis

A100/100

Scanned November 24, 2026

npx -y skills add vchelaru/Gum --skill gum-runtime-systemmanagers-init --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gum Runtime Systemmanagers Init?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gum Runtime Systemmanagers Init
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vchelaru-gum-runtime-systemmanagers-init/badge)](https://www.skillsdirectory.com/skills/vchelaru-gum-runtime-systemmanagers-init)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gum-runtime-systemmanagers-init
description: The SystemManagers.Initialize() registration contract every render backend must fulfill. Triggers: new backend implementer, CustomCreateGraphicalComponentFunc, RegisterGueInstantiation, StandardElementsManager.Initialize, LoaderManager.Self.ContentLoader, FallbackRenderableFactory.
---

# SystemManagers.Initialize() Registration Contract

Each render backend has its own `SystemManagers` (not shared — see [gum-runtime-topology](../gum-runtime-topology/SKILL.md) for why `RenderingLibrary.*` compiles into multiple assemblies). Its `Initialize()`/`Initialize(fullInstantiation: true)` is what makes that backend's renderables visible to Gum's primary runtime-type registry. There is no shared interface or base-class checklist for this — each backend hand-writes the same sequence. New backend implementers (e.g. Silk.NET, #2738) must replicate it.

## The contract

A conforming `Initialize()` must, in some order:

1. **`LoaderManager.Self.ContentLoader = new <Backend>ContentLoader();`** — wires asset loading (textures, fonts).
2. **`GraphicalUiElement.SetPropertyOnRenderable = CustomSetPropertyOnRenderable.SetPropertyOnRenderable;`** (+ usually `AddRenderableToManagers`, `RemoveRenderableFromManagers`, `UpdateFontFromProperties`) — routes `.gumx` property assignments into the backend's renderables.
3. **`ElementSaveExtensions.CustomCreateGraphicalComponentFunc = <backend's factory>;`** — the backend's own `IRenderable` factory, tried by the fallback path (see below) before `FallbackRenderableFactory`.
4. **`StandardElementsManager.Self.Initialize();`** — registers default states for the standard element types. Optional since every lookup initializes on demand; existing backends still call it.
5. **Register the 8 standard shape types** via `ElementSaveExtensions.RegisterGueInstantiation(name, () => new XRuntime())`: **Circle, ColoredRectangle, Container, NineSlice, Polygon, Rectangle, Sprite, Text**. This is the *primary* registry Gum uses to build the `GraphicalUiElement` visual tree — see the two-registry model documented at the top of `Gum/Wireframe/FallbackRenderableFactory.cs`.

Reference implementations: `RenderingLibrary/SystemManagers.cs` (MonoGame/KNI/FNA, the most complete — also loads embedded default fonts and installs a mobile/browser file-stream hook), `Runtimes/RaylibGum/RenderingLibrary/SystemManagers.cs`, `Runtimes/SkiaGum/RenderingLibrary/SystemManagers.cs`.

## Minimal backend over GumCommon alone

`Samples/Sdl3Gum` is the smallest working backend: it references only GumCommon, has no `SystemManagers`, and needs only step 3 plus `CanvasWidth`/`CanvasHeight`. `SetPropertyOnRenderable` defaults to reflection, so a renderable's public `SourceFile` property receives the `.gumx` variable. Point porters to engines Gum doesn't support there, and keep it Sprite/NineSlice only.

- **A renderable's `Children` holds the child `GraphicalUiElement`s, not their renderables.** A hand-written draw walk must reach through `IHasRenderableComponent.RenderableComponent`; checking `child is MySprite` finds nothing and draws an empty frame.

## Landmines

- **A missing shape registration doesn't throw — it silently falls back.** If step 5 skips a type, `ElementSaveExtensions`' primary registry has nothing for it, so Gum falls through to `FallbackRenderableFactory.TryHandleAsBaseType` (`Gum/Wireframe/FallbackRenderableFactory.cs`), a hardcoded per-backend switch that returns a plainer renderable (e.g. an outline-only `LineCircle` instead of the backend's preferred filled shape). This is how a backend can look like it "supports" a shape while actually degrading it — there's no compile-time or startup check that all 8 are registered. Don't extend `FallbackRenderableFactory`'s switch to paper over a missing registration in a new backend; register the real runtime wrapper in step 5 instead.
- **These are process-wide static assignments**, not instance state — `ElementSaveExtensions.CustomCreateGraphicalComponentFunc`, `GraphicalUiElement.SetPropertyOnRenderable`, `LoaderManager.Self.ContentLoader`, etc. are shared statics every backend's `Initialize()` overwrites. Running two backends (or two `SystemManagers` instances of different backends) in one process means the last `Initialize()` call wins — intentional for the typical single-backend app, but not safe to assume otherwise.
- **Extended shape types beyond the standard 8 need their own wiring, not just step 5.** Skia additionally registers `Arc`, `ColoredCircle`, `Line`, and handles `RoundedRectangle` — these aren't part of `StandardElementsManager`'s default-state set, so Skia also assigns `StandardElementsManager.Self.CustomGetDefaultState` (`HandleCustomGetDefaultState` in `Runtimes/SkiaGum/RenderingLibrary/SystemManagers.cs`) to supply default states for them. Only copy this if the new backend adds shape types beyond the standard 8.
- **A repeat `Initialize` registers only the standard types missing from the registry.** Each backend's `RegisterComponentRuntimeInstantiations(overwrite)` passes `overwrite: true` only on its first call in the process, through `ElementSaveExtensions.RegisterGueInstantiation(name, func, overwriteIfAlreadyExists)`, so a host's own registration for a standard type survives and `ElementSaveExtensions.Reset()` followed by `Initialize` returns to stock. A new backend should do the same.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in design →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.