Studio › Manual › More tools

Variable Definitions

An object's Variable Definitions pane (the bar over the object's tab, Code > Object > Variable Definitions, ⌥⌘2) lists the variables every instance gets before its Create event runs, as GameMaker's Variable Definitions window does. The room editor can give each instance its own value.

  • Add (the + menu, or Code > Object > Add Variable) makes a definition of a type: Real, Integer, String, Boolean, Expression (GML run when the instance is made), Asset, Colour or List.
  • Each row has the name, the type and the default value with the type's control: a field, a switch, a colour well, an asset drop-down or the list's items.
  • The arrow on the left opens the details: a range for numbers (a slider from the lowest to the highest value), the list items (one GML value per line: "text" in quotes, numbers or constants) and Multiselect for lists, and the asset kinds an Asset definition can name.
  • The arrows move a definition up and down; − removes it.
  • Inherited definitions from the parent chain are listed greyed below. Override gives this object its own value; Use <parent>'s goes back to the parent's.

Every change is written to the object's .yy as GameMaker writes it, and is one step of Edit > Undo.

Keys are shown as on the Mac: ⌘ Command, ⌥ Option, ⌃ Control, ⇧ Shift. Studio for Windows shows its own keys beside each menu item.