Get Tile Data In Cell


With this action you can get the tiledata for a tile cell on a tilemap layer. The tiledata is simply a value that reflects the index of the tile along with the flip, mirror, and rotate values, as well as any custom tile masks that you have used. With this action you first supply the layer to target using the name of the layer (a string) as defined in the room editor, and then the column and row of the tilemap layer to get the tiledata for. The "cell" is the area on the tilemap grid that holds the tile you want to get the data from, so if your tiles are 16x16, for example, and the room is 1024x768 the tilemap will have 64 columns and 48 rows.

NOTE: The layer selected must have been defined as a Tilemap Layer in the room editor, otherwise you may get errors.

The returned value will then be stored in the target variable which can have been created previously or can be a new temporary one (if you check the "Temp" check-box). For more information on tiledata, please see the GML section on Tilemaps - Tile Functions.

Action Syntax:

Get Tile Data In Cell Syntax


Argument Description
Layer The layer to get the tile from
Column The column (from left to right) of the cell


Set Tile Data In Cell Example
The above action block code loops through every tile cell in the room, retrieves the tiledata for the cell, flips it, then sets the cell again.