Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Introduction

Gum is a UI toolkit for C# game developers. This page is a tour of what it can do, with each feature linking to its full documentation. To download the Gum UI tool and start building your UI, see the Setup page.

Design Visually or Write Code

Build your UI in the visual editor, in C# only, or a mix of both.

A screen built in the Gum editor
// Initialize
var panel = new StackPanel();
panel.Spacing = 8;
panel.Visual.X = 16;
panel.Visual.Y = 90;
panel.AddToRoot();

var button = new Button();
button.Text = "Click Me";
button.Width = 200;
panel.AddChild(button);

var textBox = new TextBox();
textBox.Placeholder = "Enter text here...";
textBox.Width = 200;
panel.AddChild(textBox);

var checkBox = new CheckBox();
checkBox.Text = "Check me";
panel.AddChild(checkBox);

var listBox = new ListBox();
listBox.Visual.Width = 200;
listBox.Visual.Height = 120;
for (int i = 0; i < 10; i++)
    listBox.Items.Add($"Item {i}");
panel.AddChild(listBox);

Runs Everywhere

Run the same UI in MonoGame, raylib, BRUTAL, Unity, and more, on desktop, mobile, and web, with an editor for Windows, macOS, and Linux.

The same game UI on a TV, laptop, and tablet

Full UI Controls, Themed

Use ready-made controls such as Button, ListBox, TextBox, and Slider, restyle them with a built-in theme or your own styles, and operate them with a mouse, touch screen, keyboard, or gamepad.

Forms controls in the Hazard theme

Live Preview and Hot Reload

Open any screen or component in its own window running the real runtime, where buttons click, lists scroll, and text boxes take input, and see your running game update when you save a change in the editor.

The Preview window runs the real runtime next to the editor

Variable References

Point any variable at another variable or a formula, like a spreadsheet, to keep sizes and colors consistent across a project or to generate whole layouts from math, such as an instance's index.

Variable references drive each square's size, position, and rotation from its index

Components with Has-A and Is-A

Build a component once and place customized instances of it inside other components, or extend it with a base type and expose the variables each instance can change.

Components in a Gum project

States and Animations

Save sets of variable values as named states, then switch between them or animate between them on a timeline.

Scrubbing a GrowIn animation between the Small and Big states in the Animations tab

Layouts That Adapt

Position and size objects in pixels, percentages, or relative to their children, then stack, wrap, or arrange them in a grid so the layout fits any resolution.

Position and size units in the Variables tab

Gradients, Drop Shadows, and Rounded Rectangles

Draw rectangles and circles with fills, outlines, gradients, drop shadows, and rounded corners.

An item card built from Gum rectangles, with a gradient, a drop shadow, and rounded corners

Shaders and Effects

Render a container to its own texture, then fade, blend, or mask it or apply a shader to everything inside it at once.

A post-process outline shader applied to a container and its contents

Vector or Raster Art

Show sprites and NineSlice panels from image files, or SVG and Lottie vector art through SkiaSharp.

An SVG logo displayed in the Gum editor

Rich Text and Fonts

Style individual words with BBCode tags, and generate fonts at runtime from a font name and size.

Text sized with a BBCode tag

Localization

Link a CSV or RESX file to your project and switch languages in the editor to check how longer text fits your layout.

Localization files and language selection

Full Code Generation

Generate C# classes for your screens and components so your code works with typed properties instead of strings.

Generated code in the Code tab

Binding and MVVM

Bind controls to a view model so your UI stays in sync with your game data.

A settings screen in the Bubblegum theme

Native AOT Ready

Publish with Native AOT or trimming after converting your project to the JSON file format.

Customizable Down to the Renderer

Replace the visuals behind any control, down to adding your own renderable types, when styling is not enough.

The UI of Champions of Anteria

Tooling

Create projects, check for errors, and generate code from the command line with GumCli, extend the editor with plugins, and give an AI assistant the Gum documentation.

Creating a new Gum project with GumCli

Time-Tested and Reliable

Gum has been used in commercial projects of all sizes. See them on the Showcase page.

Completely Open Source

The Gum tool and every runtime are open source under the MIT license. Use them in commercial projects, read the code, and contribute on GitHub.

Need Help?

Gum is actively maintained and provides lots of ways to get answers:

Last updated

Was this helpful?