General Room Functions And Variables

Rooms in GameMaker Studio 2 are where everything happens in your game and you must have at least one room in any game for it to run, but you may need many more depending on the type of game and how you structure your project. This section has all the general GML functions and variables related to rooms and getting information about them as well as for setting certain properties within them. It should be noted that those functions related to changing room properties should never be run from within the room that you wish to change, but rather be run from an instance in another room first.

The following global variables are used for getting basic information about any given room:

You can also use the following function to get the name of the room, as it is listed in the resource tree:

The following functions are used for moving between rooms:

The following functions are used for creating rooms and changing room properties:

NOTE: These functions cannot be used with the current room otherwise errors and unpredictable behaviours can occur.

上一页: Rooms
下一页: General Layer Functions
© Copyright YoYo Games Ltd. 2018 All Rights Reserved