> 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/upgrading/breaking-changes/removal-of-variable-spaces.md).

# Removal of Variable Spaces

## Introduction

This change, introduced in source at the end of January 2025, removes all spaces from standard variable names. Gum will automatically remove these spaces from projects upon project load. If you are using version control software, you may notice a large number of changes in your Gum files due to the removal and saving of these files. In most cases no changes are required at runtime, but this page describes the change in detail in case your project depends on variable names with spaces.

## Motivation

The removal of variable spaces unifies the variable names across all standard elements. Prior to this change, some variables included spaces in their names when saved to XML (such as `X Units`), while other variables did not include spaces and instead used Pascal Case (such as `StackSpacing`).

This inconsistent spacing adds confusion when writing variable references and when assigning state variable values in code (such as when customizing standard Forms controls in code).

After this change, all variables will use Pascal Casing, making it easier to write code and variable assignments. This also allows using the `nameof` keyword when assigning variables.

## Changed Variables

The following variables have been changed to no longer include spaces in their names:

* Base Type ⇒ BaseType
* Children Layout ⇒ ChildrenLayout
* Clips Children ⇒ ClipsChildren
* Contained Type ⇒ ContainedType
* Font Scale ⇒ FontScale
* Height Units ⇒ HeightUnits
* Texture Address ⇒ TextureAddress
* Texture Height ⇒ TextureHeight
* Texture Height Scale ⇒ TextureHeightScale
* Texture Left ⇒ TextureLeft
* Texture Top ⇒ TextureTop
* Texture Width ⇒ TextureWidth
* Texture Width Scale ⇒ TextureWidthScale
* Width Units ⇒ WidthUnits
* Wraps Children ⇒ WrapsChildren
* X Origin ⇒ XOrigin
* X Units ⇒ XUnits
* Y Origin ⇒ YOrigin
* Y Units ⇒ YUnits

## Expected Changes

Projects which have been created prior to this change will likely have variables in their XML with spaces. When a new version of the Gum tool loads a file, it loops through all variables and removes their spaces.

## Runtime Changes

The runtime objects (GraphicalUiElement) have been written to accept variables with and without spaces. Therefore, even if your game updates to a new version of the Gum libraries but you haven't yet converted variables to spaces, the game should still work the same as before.

The check for variables with spaces may be removed in the future, but if so it is unlikely to happen for many years. The GraphicalUiElement object has been checking for variables with and without spaces for many years as well, so if you open an old project in Gum and convert the variables to no longer have spaces, old games will be able to load these newly-upgraded files without any problems.

## Testing

Prior to releasing this change, these have been tested on a number of projects. Each project has performed 2 tests:

1. Loading old Gum projects with the new source before the project has been upgraded
2. Upgrading the Gum project automatically by loading it in Gum and testing the project after upgrade

These changes have been tested on the following projects

* Cranky Chibi Cthulhu
* FlatRedBall Automated Test Project (.NET 6, Desktop GL)
* MonoGame Gum Forms Sample Project
* Kid Defense
* BattleCrypt Bombers

## Required Code Changes

If your code is setting any of these variables explicitly, such as creating state varaibles, you will need to adjust your code to no longer include spaces in the variable names listed above.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flatredball.com/gum/gum-tool/upgrading/breaking-changes/removal-of-variable-spaces.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
