Set Tile Data In Cell Icon Set Tile Data In Cell

With this action you can set the tile data for a tile cell on a tile map layer. The tile data 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 on the tile map layer to set the tile-data for. The "cell" is the area on the tile map grid that holds the tile you want to set the data for, so if your tiles are 16x16, for example, and the room is 1024x768 the tile map will have 64 columns and 48 rows.

NOTE The layer selected must have been defined as a Tile Map Layer in The Room Editor, otherwise you may get errors.

The final argument for the action is the tile-data itself. You would normally retrieve the tile data for the tile map cell using the action Get Tile Data In Cell and then manipulate it using the action Set Tile Data Transform before setting it again with this action. For more information on tile data, please see the GML section on Tile Map Functions.

 

Action Syntax:

Set Tile Data In Cell Action

Arguments:

ArgumentDescription
LayerThe layer with the tile map to target
ColumnsThe cell column position along the horizontal axis to set the tile-data for
RowThe cell row position along the vertical axis to set the tile-data
DataThe tile data to use for setting the cell

 

Example:

Set Tile Data In Cell ExampleThe above action block code loops through every tile cell in the room, retrieves the tile data for the cell, mirrors it, then sets the cell again.