Get Tile Index In Cell Icon Get Tile Index In Cell

With this action you can get a tile index on a given layer. The layer is specified from the layer name given (a string, as used to name the layer in the Room Editor), and then you give the row and column of the cell within the layer to get the tile index from. Finally you supply the target variable to store the returned tile index in, where 0 is no tile, and a positive integer is the index of the tile. Note that the target variable can be flagged as a temporary (local) variable that can be used until the end of the event.

 

Action Syntax:

Get Tile Index In Cell Action

Arguments:

ArgumentDescription
LayerThe layer to get the tile from
ColumnThe column (from left to right) of the cell
RowThe row (from top to bottom) of the cell
TargetThe target variable for the return value

 

Example:

Get Tile Index In Cell ExampleThe above action block code creates a loop to go through the top row of the given room layer, and as it does it checks to see if the tile indexed at the cell for the column is set to 0. If it is not the tile index for that cell is set to 0 and the temporary (local) variable is incremented before the loop does another set of checks.