> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/gum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/gum/gum-tool/readme.md).

# 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](/gum/gum-tool/setup.md) page.

### [Design Visually or Write Code](/gum/gum-tool/editor-tab.md)

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

{% tabs %}
{% tab title="Editor" %}

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-6e46a3ea124b33c1f357e318805dc15d546f8572%2F15_09%2045%2030.png?alt=media" alt=""><figcaption><p>A screen built in the Gum editor</p></figcaption></figure>
{% endtab %}

{% tab title="Code" %}

```csharp
// 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);
```

{% endtab %}
{% endtabs %}

### [Runs Everywhere](/gum/code/about/runtimes.md)

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

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-2550ac96ad04265d5c0dafb37f01b648e71bf43a%2F15_10%2048%2005.webp?alt=media" alt=""><figcaption><p>The same game UI on a TV, laptop, and tablet</p></figcaption></figure>

### [Full UI Controls, Themed](/gum/code/controls.md)

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.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-48c74227a0dba04906d300c4b50255093240f755%2F15_10%2002%2011.png?alt=media" alt=""><figcaption><p>Forms controls in the Hazard theme</p></figcaption></figure>

### [Live Preview and Hot Reload](/gum/gum-tool/editor-tab.md#preview)

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.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-b34fb728e31b9d2a2eceaeedd37481c2fff66de5%2F15_14%2038%2024.gif?alt=media" alt=""><figcaption><p>The Preview window runs the real runtime next to the editor</p></figcaption></figure>

### [Variable References](/gum/gum-tool/gum-elements/general-properties/variable-references.md)

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.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-e17d9430d114b3ff32422234a4ec4aaf7bdb1ec5%2F15_15%2003%2044.png?alt=media" alt=""><figcaption><p>Variable references drive each square's size, position, and rotation from its index</p></figcaption></figure>

### [Components with Has-A and Is-A](/gum/gum-tool/gum-elements/component.md)

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.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-0950bd4ee3a6bf3da87b9e022a54de176a936917%2F30_06%2054%2043.png?alt=media" alt=""><figcaption><p>Components in a Gum project</p></figcaption></figure>

### [States and Animations](/gum/gum-tool/gum-elements/states.md)

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

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-ef5bb41f57176bf7e59c32c5ac4dc50028b5dfe9%2F15_14%2052%2015.gif?alt=media" alt=""><figcaption><p>Scrubbing a GrowIn animation between the Small and Big states in the Animations tab</p></figcaption></figure>

### [Layouts That Adapt](/gum/gum-tool/gum-elements/general-properties/x-units.md)

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.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-7d6f3048238d241703ecd6ecf8091c296db7c494%2F15_15%2058%2030.png?alt=media" alt=""><figcaption><p>Position and size units in the Variables tab</p></figcaption></figure>

### [Gradients, Drop Shadows, and Rounded Rectangles](/gum/gum-tool/gum-elements/rectangle.md)

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

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-8ad050f0a48c2fd7d69b214bcc28ba87a1c7be92%2F15_16%2012%2040.png?alt=media" alt=""><figcaption><p>An item card built from Gum rectangles, with a gradient, a drop shadow, and rounded corners</p></figcaption></figure>

### [Shaders and Effects](/gum/code/standard-visuals/containerruntime.md#render-target-shaders-rendertargeteffect)

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

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-116b0e5c979973028c09950791c55dabe55de52c%2F15_15%2022%2007.png?alt=media" alt=""><figcaption><p>A post-process outline shader applied to a container and its contents</p></figcaption></figure>

### [Vector or Raster Art](/gum/gum-tool/gum-elements/skia-standard-elements.md)

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

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-d4eb79fbd5e5f007e98db5f9926e31f2fc088b48%2F15_15%2031%2040.png?alt=media" alt=""><figcaption><p>An SVG logo displayed in the Gum editor</p></figcaption></figure>

### [Rich Text and Fonts](/gum/code/standard-visuals/textruntime/bbcode.md)

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

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-b2b8fc65bebd440a474bc010cc4325e1c272d8b6%2FThisIsBiggerText.png?alt=media" alt=""><figcaption><p>Text sized with a BBCode tag</p></figcaption></figure>

### [Localization](/gum/gum-tool/localization.md)

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

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-34b86ffb387b7a986f559b6ed5d7539426d61a75%2F15_13%2016%2027.png?alt=media" alt=""><figcaption><p>Localization files and language selection</p></figcaption></figure>

### [Full Code Generation](/gum/gum-tool/code-tab.md)

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

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-32ae00eb5806707575e51fe2b83afc159c89b7ec%2F09_06%2039%2027.png?alt=media&amp;token=7fc20e77-20d6-4c21-b31a-b6d1b1ece24f" alt=""><figcaption><p>Generated code in the Code tab</p></figcaption></figure>

### [Binding and MVVM](/gum/code/binding-viewmodels.md)

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

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-ff9f4de7cfbdda96b94a0491037516ca4d1a7e47%2FBubblegumThemeScreenshot.png?alt=media" alt=""><figcaption><p>A settings screen in the Bubblegum theme</p></figcaption></figure>

### [Native AOT Ready](/gum/code/performance-and-optimization/native-aot-and-trimming.md)

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

### [Customizable Down to the Renderer](/gum/code/styling/code-only-styling/adding-and-removing-visual-children.md)

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

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-af7917122c032a2b4f62363c122ab9e954e6738e%2FLegends2.jpg?alt=media" alt=""><figcaption><p>The UI of Champions of Anteria</p></figcaption></figure>

### [Tooling](/gum/cli/cli.md)

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.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-be388f8f32b586bee597445382056e7cf575cbcc%2F15_15%2045%2012.png?alt=media" alt=""><figcaption><p>Creating a new Gum project with GumCli</p></figcaption></figure>

### Time-Tested and Reliable

Gum has been used in commercial projects of all sizes. See them on the [Showcase](/gum/gum-tool/showcase.md) page.

### Need Help?

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

* Check the rest of the documentation
* Join the [Discord chat](https://discord.gg/EvqwmSQuBz) (shared discord with FlatRedBall)
* Create an [issue on GitHub](https://github.com/vchelaru/Gum/issues)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flatredball.com/gum/gum-tool/readme.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
