1 - The Basics
Introduction
This page walks you through the basics of using the Gum UI tool, which we'll refer to simply as Gum for this and all other documentation.

Gum Elements
Gum separates its elements into three categories: Screens, Components, and Standard. Behaviors are an advanced topic that we'll skip for these tutorials.

Standard elements represent the building-blocks for screens and components. Let's take a look at the different types next.
Standard Types
Circle - a circle which can be filled in, outlined, or both. Often used for visualizations or for defining collision in your Gum objects for a game.
Container - invisible object used to contain other objects. These are used to provide margins, change layouts (such as vertical vs horizontal stacking), and to organize your UI.
NineSlice - visual object which uses nine sprites to create a resizable object from a source PNG (or portion of a PNG). The corner sprites (4) are not resized. The top, bottom, left, and right sprites are stretched on one axis. The middle sprite stretches both horizontally and vertically. These are used to create resizable frames.
Polygon - polygon outline which can have any number of points. These are usually not used for UI, but can be used if you are defining collision in your Gum objects for a game.
Rectangle - a rectangle which can be filled in, outlined, or both. Used for solid-colored backgrounds, frames, blocking out a UI, or for defining collision in your Gum objects for a game.
Sprite - a visual object which displays a source PNG (or a portion of a PNG). These are used for icons, backgrounds, and other visual objects which are usually not resized dynamically.
Text - a visual object which can display characters. These are used for any situation where text needs to be displayed such as labels and paragraphs.
Components
Components are objects which can contain standard elements and instances of other components. Components can be very simple, such as a Label, or very complex, such as an options menu with dozens of instances. Items added to components or screens are called instances.
Screens
Screens are objects which can contain standard elements and instances of other components. Unlike Components, Screens cannot be added to other Screens. Screens exist mainly for organization. Screens can be simple, such as a loading screen, or complex such as a HUD in an RTS game.
Components vs. Screens
Components and screens are similar - both can contain instances of standard elements, and both can contain other components. The only difference between screens and components is that screens cannot contain other screens.
For example you can think of screens in a video game which might include a main menu, credits screen, options screen, and level selection screen. You can think of components as elements which are composed of multiple standard elements. Examples include a Button component which is made up of a Sprite instance and a Text instance, or a Logo component which may be made up of multiple Sprites and Text objects.
Creating a Project
Before you work on your project, you must first create a new project. Gum creates a new folder for the project, so you can pick any location on your computer.
To create a project:
Select File > New Project
Enter a Project name, such as
MyProject.Un-check the Include Forms controls option - this tutorial assumes a completely empty project.
Set the Location. If you are using a library like MonoGame or raylib, you may want to create the project under your game project, such as in a Content or Resources folder.
Click OK.
See Creating a Project for the other options in the dialog.
Once your project has been created you should see its name in Gum's title bar.

Creating a Screen
To create a screen:
Right-click on the Screens tree item and select Add Screen

Right-click, Add Screen option Enter the name of the new screen - such as MainMenu
Click OK. The newly-created screen is created and selected

The MainMenu screen in Gum
Adding instances
Instances of standard and component elements can be added to screens and components. To add an instance:
Select the destination screen or component. For example, select the MainMenu screen
Drag the Text item onto the Editor tab
Release the mouse button. A new text instance appears in your screen.

Adding a Text instance to the MainMenu screen in the Editor tab
Alternatively, you can also drag+drop a standard element into a screen in the tree view.

Editing in the preview window
Once an instance is a part of a screen or component it can be edited visually in the preview window. The selected instance has eight (8) handles surrounding it. These are called the resize handles and can be used to change the selected instance's width and height.

In the case of the Text object, the resize handles are used to control how the text object performs line wrapping.
You can use the resize handles to resize the instance, or you can simply push the mouse button and drag inside the instance to change its position. Notice that an object's outline is displayed when the cursor is hovering over the instance.

Conclusion
This tutorial introduces the basics of working with standard elements and adding them to Screens. The next tutorial covers the Variables tab which can be used to access all element variables.
Last updated
Was this helpful?

