01 – Setup


FlatRedBall.Forms is an easy-to-use UI library for games. This tutorial will walk you through setup of a game project including FlatRedBall.Forms.

(Optional) Linking to FlatRedBall.Forms and GumCore Source

FlatRedBall.Forms source code can be linked in your game project if you want cutting-edge features, improved debugging, or to contribute. For information on linking, see the following link:

Linking Gum Files In Source

Creating a Glue Project

First we’ll create a Glue project. If you already have a Glue project you can skip this section.

To create a new project:

  1. Open Glue
  2. Select File -> New Project

  3. Select the Empty Project category
  4. Select Desktop GL as the project type (additional platforms can be added later)
  5. Enter a project name such as FormsProject
  6. Click the Make my Project! button

Now we have a project that is ready to go. Note that if you already have an existing FlatRedBall project, you can continue on the next step.

Adding a Gum Project

Next we’ll add a Gum project to the FlatRedBall project. Note that if your project already has a Gum project. To add a project:

  1. Click the Gum icon in Glue to add a new Gum project

    Note that if you already have a Gum project, this icon will open the file in Gum

  2. Click the Gum project and select the Gum Properties tab (this should automatically be selected if you just created the Gum project)

  3. Click the Add Forms to Project button

Adding a Button

Now that we have a Gum project we’ll add a button to the Gum screen. For this example we’ll add the button purely through Gum (no code involved).

To add a button:

  1. Right-click on the Glue Screens folder and select Add Screen

  2. Enter a name for the new screen and click OK

    Note that by default this will also create a Gum screen

  3. Click the Gum icon to open Gum

  4. Click GameScreenGum (the Gum screen for the newly-created Glue screen)

  5. Expand the Components -> DefaultForms folder
  6. Drag+drop the Button component onto the GameScreen

The Button should now appear in the Gum.

Running the game will also show a fully-functional button.