Set Tile Data Transform Icon Set Tile Data Transform

With this action you can change one of three tile transforms in the tile data. You supply the variable that holds the tile data for the tile, then select the transform to change. Clicking the "Apply" check-box will apply that transform and un-checking it will remove it. The tile data is simply a value that reflects the index of the tile along with the transforms applied as well as any custom tile masks that you have used, and this action permits you to change three of those values: Flip, mirror and rotate. Note that you will normally want to get the tile data first using either Get Tile Data In Cell or Get Tile Data At Pixel, then apply the required transform(s) and then set the tile in the tile map again using Set Tile Data In Cell or Set Tile Data At Pixel, since this action only sets a value but does not apply it to the tile it was taken from. For more information on tile data, please see the GML section on Tile Map Functions.

 

Action Syntax:

Set Tile Data Transform Action

Arguments:

ArgumentDescription
TileThe tile data for the tile to change
TransformThe transform to apply/remove

 

Example:

Set Tile Data Transform ExampleThe above action block code gets the tile data at the mouse position and then checks to see if the tile has had a rotation transform applied to it. If it has then the transform is reset and the tile data sets the tile at the position again.