This section of the manual is a reference guide for the GameMaker Studio 2 Language (GML). You can find all the available functions documented here along with the required arguments and examples of code to show how they can be used. For information on how to use GML please see the GML Overview section of the manual.
The following sections explain the functions that you have available to you for manipulating the different resources in your project, including creating new dynamic resources or editing and changing those that are added into your game through the resource tree.
There are two extra functions related to the handling of game resources. These functions can be used to find the unique index value for any given resource and the type of resource that it is, which opens the door to dynamically creating game resources from strings (for example):
This section contains the functions and variables that are all related to game specific functionality, like loading/saving or restarting etc...
GameMaker Studio 2 has a great number of ways in which you can move instances around within your game room, ranging from setting speed and direction vectors to simply "placing" an instance at a specific position, as well as using more sophisticated methods like path-finding. There are also a good number of different methods for detecting collisions between two instances, and which you choose will depend largely on the type of game you are making and the exact situation that you need to use the collision functions in. The following sections cover all of this and list all the functions related to movement, path-finding and collisions:
The following sections are all related to graphics operations in one way or another, whether it is drawing something to the screen, manipulating surfaces, or creating your own cameras or vertex formats:
The following sections contain all the functions and built in variables that are used for setting up view cameras, view ports and the game window, as well as setting the GUI display for your game projects.
There are a number of different ways that you can let players control things ion your game, from using the keyboard and mouse to creating virtual keys or using the gamepad, and they are all listed in the following sections:
Data structures are basically different ways that you can store large amounts of data. Which one you use will depend entirely upon the needs of the situation and you should read the introduction page of each section to get a better idea of how they work and when they can be used:
The following sections list the functions for working with instance and global variables as well as for working with arrays (note that the variable functions are designed to be used when converting DnD™ code to GML code or for use in compatibility scripts more than for general use in new projects):
The following sections contain all the functions and built in variables that are used for working with strings:
The following sections contain all the functions and built in variables that are used for working with different number values:
The following sections all deal with different aspects of the GameMaker Studio 2 Box 2D physics implementation:
The following section has all the functions related to the In App Purchase system (note that these functions work in conjunction with the IAP Asynchronous Event):
The following sections have a collection of functions that all work with, or trigger, the Asynchronous Events, including the HTTP functions, Cloud functions and a few others:
This section has all the functions related to creating networked games (ie: games that communicate with each other over the internet):
This section has functions specific to creating HTML5 web applications as well as a few more general web functions for opening URLs etc...
GameMaker Studio 2 is fully integrated with the Steamworks API so that you can create your games with that platform in in mind, and integrate the different services that it offers from day one of development. See the sections below for more information:
While making a game you will, at some point, need to store information about the game state to a file. To that end, GameMaker Studio 2 has a number of different functions for this, enabling you to read and write data to various different file types:
Buffers enable you to directly access areas of memory, adding, removing and saving information as raw data. Below you can find a detailed explanation of what buffers are and how to use them as well as all the functions related to them:
The functions in this section are specifically for use with the UWP target, and then only when using UWP to target the Xbox One. The functions give you basic access to XBox Live features:
This section contains a number of functions that are for doing very specific things when creating your game and that don't fit exactly into any of the other function groups on this page:
Debugging your code is an essential part of making games and apart from the tools provide by GameMaker Studio 2 (like the Debug Module), there are also a few extra functions to help you:
Please note that there are certain functions that have been added to the IDE which will show up only in the compatibility scripts when you import a game made with a previous version of GameMaker Studio. These functions should not be used and are only designed for compatibility. The following section of the manual lists these functions so that if you see them you know what they are, but please avoid using them in your projects: