githubEdit

Shapes (Apos.Shapes)

Introduction

GumUI supports rendering vector shapes as visuals. The following shapes are supported.

  • ArcRuntime

  • ColoredCircleRuntime

  • RoundedRectangleRuntime

Adding NuGet packages

The Gum.Shapes.MonoGame NuGet package adds support for rendering shapes. Add the following NuGet package:

https://www.nuget.org/packages/Gum.Shapes.MonoGamearrow-up-right

Modify csproj:

<PackageReference Include="Gum.Shapes.MonoGame" Version="*" />

Or add through command line:

dotnet add package Gum.Shapes.MonoGame

Future versions of Gum may not require adding this package explicitly.

Setup in Code

Whether you are using code-only or the Gum tool, you must add the following line of code in your Initialize method:

If using December 2025 or earlier:

GumUI.Initialize(...);
// Initialize ShapeRenderer after GumUI:
ShapeRenderer.Self.Initialize(GraphicsDevice, Content);

If using January 2026 or later:

GumUI.Initialize(...);
// Initialize ShapeRenderer after GumUI:
ShapeRenderer.Self.Initialize();

Code Example: Rendering Shapes in Code

The following code shows how to add shapes to a MonoGame project:

Shapes rendered in an otherwise empty project

Setup in Gum Tool

Shapes can be used in the Gum tool. To add shapes:

  1. Launch the Gum tool

  2. Select Plugins ⇒ Add Skia Standard Elements

  3. Add instances of Arc, ColoredCircle, or RoundedRectangleRuntime to your Screens or Components

For information on using these shapes in the Gum tool, see the Arc, ColoredCircle, and RoundedRectangle pages. These shapes all share common values for fill, gradients, dropshadows. For information on these general properties, see the Skia Element General Properties page.

circle-exclamation

Screens and components containing shapes mentioned above can be loaded with no code gen, by reference code gen, or full code gen (no .gumx loaded at runtime).

Shapes in the Gum tool

Last updated

Was this helpful?