GlueView

Introduction

GlueView (officially version 2) is a new set of features added to Glue in late 2021. GlueView allows you to preview your game and entities. It also provides editing abilities for instances and Tiled files.

Requirements

To use GlueView with all features, your project should use the Screen-as-a-Level pattern. This means that your game has a GameScreen, and that every level in the game is its own Screen such as Level1, Level2, etc. This pattern is recommended for all FlatRedBall projects and it is the pattern used in the platformer tutorials.

Note that you do not necessarily need to use Screen-as-a-Level pattern, but doing so enables the full GlueView feature set.

Enabling Edit Mode

GlueView is technology which is added to your game by Glue through code generation. Once added, your game also acts as a level editor which can receive updates from Glue without restarting. This can greatly improve iteration speed and allows editing to be done in the actual game as opposed to a separate level editor.

To enable edit mode on a project:

  1. Open your project in Glue
  2. Select the Build tab in Glue
  3. Check the Generate GlueControlManager in Game1 checkbox. Note that a port number is displayed. You do not need to change this port unless it defaults to a port that is already being used by another process.

  4. Run your game from either Visual Studio or Glue – you can do either and Glue will detect that the game is running. When the game is running, the Build tab will change to include new buttons and options.

  5. Click the Edit button to make the game run in edit mode. The game will display grid lines to indicate that it is in edit mode.

You can switch between Edit and Play mode anytime by changing the selected option.

Selecting and Previewing

GlueView automatically displays the selected level in Edit mode. GlueView responds to the following selections in Glue

  • Select a Screen (or Level)

 

  • Select an entity to view it in game. The game creates a preview screen allowing you to view and edit the entity by itself.

 

  • Select an object in a Screen or Entity to highlight it

 

  • Select a state to preview it

 

  • States can also be previewed by selecting a state in the StateData editor grid to preview it as well

 

  • Select an object in a screen by clicking on it in game and it will select in Glue

 

  • Double-click to punch through and select overlapping objects

Camera Controls

The Camera in Edit mode can be controlled using the following methods:

  • Hold the middle mouse button to pan

 

  • Hold the CTRL key and press the arrow keys. Holding the arrow keys will continue to pan.

 

  • Push+hold the left mouse button and move to the edge of the screen

 

  • Scroll the mouse wheel to zoom in and out

 

  • Hold the CTRL key and press + or – to zoom in and out

Moving and Changing Object Variables

Changes in Glue will immediately apply if the game is in edit mode. GlueView provides the following ways to edit:

  • Change a value (such as X or Y) in Glue to see the change in your game

 

  • Push+drag to move objects in the game – the variables will update automatically in Glue to match the new position

 

  • Drag objects to the edge of the screen to pan the camera if they need to be placed off screen

 

  • Multiple objects can be selected and moved at once by holding down the CTRL key and clicking each object

 

  • Math operations can be used to change numerical values

 

  • Along with primitive types (such as numerical values), states can also be set on instances

 

  • CSV values can also be applied to instances

Creating New Objects

Creating a new object in Glue automatically updates the game with the new object. New objects can be added to levels or entities.

  • New level objects can be added through the Add Object Quick Action

 

  • Glue also supports Drag+drop to add objects to a level

 

  • New objects can also be added by selecting their list and using the Quick Action button

 

  • New objects can be created by using the CTRL+C, CTR+V shortcut in game. This is especially useful when placing multiple objects in game. When pasting a grabbed object, the new object will be placed at the same location as the grabbed object.

 

  • Objects added to Entities will automatically appear on instances of that entity

Working with Files

GlueView supports adding files at runtime and automatically updating to changes.

  • New files can be added from the file system. These files will be loaded dynamically.

 

  • External changes to files are automatically reloaded

 

  • Changes to TMX files which can create entities and collision will automatically update these objects so they can be tested immediately. For example, painting collision tiles immediately allows testing the new level without restarting.