Gum.Themes.Template.MonoGame
2026.6.12.1
See the version list below for details.
dotnet add package Gum.Themes.Template.MonoGame --version 2026.6.12.1
NuGet\Install-Package Gum.Themes.Template.MonoGame -Version 2026.6.12.1
<PackageReference Include="Gum.Themes.Template.MonoGame" Version="2026.6.12.1" />
<PackageVersion Include="Gum.Themes.Template.MonoGame" Version="2026.6.12.1" />
<PackageReference Include="Gum.Themes.Template.MonoGame" />
paket add Gum.Themes.Template.MonoGame --version 2026.6.12.1
#r "nuget: Gum.Themes.Template.MonoGame, 2026.6.12.1"
#:package Gum.Themes.Template.MonoGame@2026.6.12.1
#addin nuget:?package=Gum.Themes.Template.MonoGame&version=2026.6.12.1
#tool nuget:?package=Gum.Themes.Template.MonoGame&version=2026.6.12.1
Gum.Themes.Template
A starting point for building a new Gum theme. A theme restyles Gum Forms controls by subclassing their V3 default visuals; this project sets up that structure so you can focus on the look instead of the plumbing.
For how a finished theme is consumed (install the package, call
Apply), see the user guide: https://docs.flatredball.com/gum/code/styling/themes
What's here
| File | Role |
|---|---|
TemplateTheme.cs |
Entry point. Apply(GraphicsDevice) registers fonts, sets the shared styling tokens, and installs the visuals as the default Forms templates. |
TemplatePalette.cs |
The one place colors live. Base tokens transcribed from your design's CSS, plus derived hover/press colors computed via Adjust. |
TemplateShapes.cs |
Factory helpers for the Apos.Shapes runtimes (filled rect, stroked border, focus ring, circles). Keeps each visual short. |
TemplateTextInputDecoration.cs |
Shared shape stack + state wiring for TextBox and PasswordBox. |
*Visual.cs |
One per styled control. Each subclasses a Gum.Forms.DefaultVisuals.V3.*Visual, swaps in shapes, and re-wires the state callbacks. |
Variants/ |
Opt-in Rich alternates for a representative control subset (pill + hard-offset-shadow button, rounded box, soft focus glow, dashed-outline panel, circular drop-shadow thumb). Not registered by default — copy the ones matching your design. See Choosing a style below. |
Content/Fonts/ |
Embedded TTFs — a display font, a body font (the multi-font demo), and an icon font for glyphs the others lack. |
The .Kni project source-shares every .cs from this project and re-embeds the
fonts under its own assembly name — one set of code, two backend packages.
Making your own theme
- Clone both projects (
.MonoGameand.Kni) and renameTemplate→YourTheme: folder names, file names, the<PackageId>, thenamespace, and the fourTemplate*type names (TemplateTheme,TemplatePalette,TemplateShapes,TemplateTextInputDecoration). The per-control visual class names (ButtonVisual, etc.) stay the same — the namespace distinguishes them. Don't do a blind global find-replace of the wordTemplate. Three Gum framework identifiers also contain it and must not be renamed:VisualTemplate,DefaultFormsTemplates, andScrollViewerVisualTemplate. The template deliberately keeps its own element names prefix-free (e.g."BoxFill", not"TemplateBoxFill"), so the only theme-ownedTemplatetokens are the namespace and those four type names — rename exactly those (a whole-word / case-sensitive replace of each), and leave the framework identifiers alone. Leave<AssemblyName>and<RootNamespace>unset in both csprojs: they default to the project name and must stay equal, because the embedded fonts are looked up by assembly name but live under the root namespace. If those diverge, the build still succeeds but fonts throwFileNotFoundExceptionat runtime — so rename the.csprojfiles and folders, not just the<PackageId>. - Fill in the palette. Transcribe your design's
:root { --bg: …; }block into the base tokens inTemplatePalette. Leave the derived colors computed unless your design pins an exact value. The standard slots are a starting vocabulary, not a cage — add tokens for anything your design defines (extra accents, success/danger, etc.) and delete the ones you don't use. - Swap the fonts. Drop your TTFs into
Content/Fonts/, update the<EmbeddedResource>entries in both csprojs, and updateFontFamily/IconFontFamily/RegisterBundledFontsin the theme class. Keep the license files alongside the fonts and packed in the csproj. Need static TTFs, not a variable font. KernSmith rasterizes static TTFs; it does not select instances from a variable font (a singleFoo[wght].ttfcarrying every weight). Many modern Google Fonts ship VF-only — if yours does, fetch its static weight cuts, or approximate with a static sibling family (e.g. theCondensedvariant) and map one cut to each Gum style slot (null→ Normal,"Bold", etc.). google-webfonts-helper (gwfh.mranftl.com) serves static cuts of VF-only Google fonts. This template ships two families — see Two typefaces. - Restyle the visuals, and as you build out a control, move it from the
"stock V3" block in
RegisterVisualsup to the styled block. - Verify by running, not just building. Build both
.MonoGameand.Kni, then add the theme to theMonoGameGumThemesShowcasesample (aProjectReferenceplus oneThemeOptionentry) and run it.Applyand font loading only fail at runtime — this is where a fontFileNotFoundExceptionfrom an uneven rename shows. - Publish: flip
<GeneratePackageOnBuild>totruein both csprojs.
Choosing a style: flat default, or the Rich variants
The registered visuals are flat and rectangular — no shadows, gradients, bevels, or
pills. The Variants/ folder ships Rich alternates (Gum.Themes.Template.Variants)
for a representative subset of controls, each demonstrating one technique: a pill
button with a flat hard-offset "stacked card" shadow, a rounded check box, a soft
focus-ring glow, a dashed-outline list panel, and a circular drop-shadow slider thumb.
Each variant copies its flat sibling's palette and state wiring and changes only the
shapes, so the two are interchangeable per control.
They're not registered by default — RegisterVisuals carries a commented swap-in
line per control. To adopt one, uncomment its line (or register
new Variants.YourControlVisual(...)), then delete the variant files you don't want.
For looks beyond the gallery, crib from the closest shipped theme:
- Drop shadows / soft glows → Bubblegum, plus the "Drop shadows" section of the
gum-themingskill (native Apos.Shapes shadow — soft = bump the alpha; hard "stacked card" edge = an opaque color with blur 0). - Gradients → ForestGlade.
- Bevels / inset edges (Win95-style) → Retro95.
- Pills / large rounded corners → a larger
CornerRadiuson the rect shapes. - NineSlice instead of Apos.Shapes → Editor.
Two typefaces
Styling.Text carries a single family — the display default (FontFamily), which
flows to every control. This template also bundles a body family (BodyFontFamily)
and opts the typed / list / menu / tooltip visuals into it via
TextInstance.Font = TemplateTheme.BodyFontFamily. Collapse to one family by deleting
BodyFontFamily, its RegisterBundledFonts lines, and those per-visual opt-ins; add a
third family the same way. For a family with no italic cut, point the Italic /
BoldItalic style slots at the upright files (as the template does for the body font)
so a stray italic request still resolves to a real font.
Conventions worth keeping
- Read colors from the palette, never inline
new Color(...)in a visual. That's what keeps a restyle to one file. - Build chrome with
TemplateShapesfor the common centered/full-parent shapes; build bespoke geometry (e.g. a left-anchored fill bar) inline. - Re-wire state callbacks with
=, not+=— you're replacing the base's behavior (which targets children you detached), not adding to it. - See the
gum-themingskill for the full set of gotchas (clip-container ordering,HasEventson wrappers, focus-ring z-order, the cross-runtime packaging pattern).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- FlatRedBall.GumCommon (>= 2026.6.12.1)
- Gum.MonoGame (>= 2026.6.12.1)
- Gum.Shapes.MonoGame (>= 2026.6.12.1)
- KernSmith.MonoGameGum (>= 0.15.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.6.15.1-preview.2 | 86 | 6/15/2026 |
| 2026.6.14.1-preview.1 | 60 | 6/14/2026 |
| 2026.6.12.1 | 117 | 6/12/2026 |
| 2026.6.6.1 | 111 | 6/6/2026 |
| 2026.5.31.1 | 109 | 6/1/2026 |