LogoLogo
  • Gum Tool
    • Introduction
    • Setup
      • Running from Source
    • Showcase
    • Tutorials and Examples
      • Intro Tutorials
        • 1 - The Basics
        • 2 - Variables Tab
        • 3 - Files
        • 4 - Components
        • 5 - Exposing Variables
        • 6 - Parent
        • 7 - States
        • 8 - State Categories
      • Animation Tutorials
        • 1 - Introduction to Animation
        • 2 - Creating an Animation
        • 3 - Playing Animations inside other Animations
        • 4 - Combining Multiple Categories
      • Examples
        • Bottom-Up Stack
        • Centering
        • Custom NineSlice
        • Health Bar
        • Padding
    • Gum Elements
      • General Properties
        • Alpha
        • Base Type (Inheritance)
        • Blend
        • Clips Children
        • Has Events
        • Height Units
        • Ignored By Parent Size
        • Locked
        • Max Height
        • Max Width
        • Min Height
        • Min Width
        • Order
        • Parent
        • Rotation
        • Visible
        • Variable References
        • Width Units
        • X
        • X Origin
        • X Units
        • Y
        • Y Origin
        • Y Units
      • Behaviors
        • Default Implementation
      • Circle
      • ColoredRectangle
      • Component
        • Default Child Container
      • Container
        • Children Layout
        • Contained Type
        • Is Render Target
        • Stack Spacing
        • Wraps Children
      • NineSlice
        • Blend
        • Custom Frame Texture Coordinate Width
        • Texture Address
        • Texture Left
        • Texture Top
      • Polygon
        • Points
      • Skia Standard Elements
        • General Properties
          • Has Dropshadow
          • Is Filled
          • Use Gradient
        • Arc
          • Start Angle
          • Sweep Angle
          • Thickness
        • Canvas
        • ColoredCircle
        • LottieAnimation
        • RoundedRectangle
          • Corner Radius
        • Svg
      • Sprite
        • Color
        • Source File
        • Texture Address
        • Wrap
      • States
        • Categories
      • Text
        • Blue
        • Color
        • Font
        • Font Scale
        • Font Size
        • Green
        • Is Bold
        • Is Italic
        • MaxLettersToShow
        • Outline Thickness
        • Red
        • Text
        • Text Overflow Horizontal Mode
        • Text Overflow Vertical Mode
        • Use Custom Font
        • Use Font Smoothing
    • Project Tab
    • Code Tab
      • Runtime Generation Details
      • Generation Scope
      • Inheritance Location
      • Is CodeGen Plugin Enabled
      • Show CodeGen Preview
    • Localization
    • Menu
      • Content
      • Project Properties
    • Plugins
      • AddAndRemoveVariablesForType
      • AddMenuItem
      • Export
      • Setting Up Post Build Events
    • Variables
      • Add Variable
    • Bitmap font generator (.fnt)
    • Upgrading
      • Migrating 2025 April 27 to May 28
      • Breaking Changes
        • Removal of Variable Spaces
  • Code
    • Gum Code Reference
      • AnimationRuntime
      • BitmapCharacterInfo
      • BitmapFont
      • Camera
      • CircleRuntime
      • ColoredRectangleRuntime
      • Component Runtimes
      • ContainerRuntime
      • Cursor
      • Gum Class Overview
      • DataUiGrid
        • Reflection
        • Categories
      • ElementSave
        • ToGraphicalUiElement
      • GraphicalUiElement
        • Absolute Values
        • AddToManagers
        • AnimateSelf
        • ApplyState
        • BlendState
        • CanvasHeight
        • CanvasWidth
        • Children
        • ContainedElements
        • Font Values
        • GetAbsoluteHeight
        • GetAbsoluteWidth
        • GetChildByNameRecursively
        • GetFrameworkElementByName
        • IsAllLayoutSuspended
        • Parent
        • RemoveFromManagers
        • UpdateLayout
      • GumProjectSave
      • IDataUi
      • InstanceMember
      • InstanceSave
      • InteractiveGue
        • CurrentInputReceiver
        • RaiseChildrenEventsOutsideOfBounds
        • RollOverBubbling
      • IPositionedSizedObject
      • Layer
      • NineSliceRuntime
      • RectangleRuntime
      • Renderer
        • SinglePixelTexture
      • SelectedState
      • SpriteRenderer
        • LastFrameDrawStates
      • SpriteRuntime
        • TextureAddress
        • TextureHeight
        • TextureLeft
        • TextureTop
        • TextureWidth
      • TextRuntime
        • Color
        • FontScale
        • FontSize
        • HorizontalAlignment
        • Text Wrapping
        • VerticalAlignment
      • VariableSave
    • FNA
    • Kni
    • Meadow
    • MonoGame
      • Setup
        • Linking Game Project to Source (Optional)
      • Tutorials
        • Gum Project Forms Tutorial
          • Setup
          • Gum Screens
          • Common Component Types
          • Styling
          • Multiple Screens
        • Code-Only Gum Forms Tutorial
          • Setup
          • Forms Controls
          • ListBox Items
          • Input in Forms
        • [Deprecated] Gum Project (.gumx) Tutorial
          • Setup
          • Gum Screens
          • Gum Forms
          • Customizing Forms
          • Strongly Typed Components Using Code Generation
          • Multiple Screens
      • Setup for GumBatch (Optional)
      • Loading a Gum Project (Optional)
      • async Programming
      • Custom Runtimes
      • GumBatch
      • Gum Forms
        • Binding (ViewModels)
        • Controls
          • Button
          • CheckBox
          • FrameworkElement
            • BindingContext
            • IsEnabled
            • IsFocused
            • ModalRoot and PopupRoot
            • SetBinding
          • Label
          • ListBox
          • ListBoxItem
          • MenuItem
          • PasswordBox
          • RadioButton
          • ScrollViewer
            • VerticalScrollBarValue
          • StackPanel
          • Slider
          • TextBox
          • Window
        • Control Customization In Code
          • MenuItem
        • Control Customization in Gum Tool
        • Gamepad Support
        • Keyboard Support
        • Troubleshooting
      • File Loading
      • Resizing the Game Window
      • Known Issues
      • Samples
        • MonoGameGumFormsSample
    • Nez
    • Silk.NET
    • SkiaGum
      • Setup
        • WPF
    • .NET MAUI
      • Setup
Powered by GitBook
On this page
  • Introduction
  • Motivation
  • Changed Variables
  • Expected Changes
  • Runtime Changes
  • Testing
  • Required Code Changes

Was this helpful?

Edit on GitHub
Export as PDF
  1. Gum Tool
  2. Upgrading
  3. Breaking Changes

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.

PreviousBreaking ChangesNextGum Code Reference

Last updated 4 months ago

Was this helpful?