tmSetTileAuto

Sets a cell to a terrain, or empties it, then picks the right tile for it and its 8 neighbours. Neighbours that aren't this terrain are left alone, and the edge of the map counts as the same terrain. Takes map (The map's handle), layer (The layer's number, from tmAddLayer or tmGetLayer), x (The tile column, from 0), y (The tile row, from 0), terrain (The terrain number from tmSetTerrain, or 0 to empty the cell). Returns nothing.

Tilemap

Parameters & Returns

Parameters

map Int
layer Int
x Int
y Int
terrain Int

Returns

Void

Quick Summary

Sets a cell to a terrain, or empties it, then picks the right tile for it and its 8 neighbours. Neighbours that aren't this terrain are left alone, and the edge of the map counts as the same terrain. Takes map (The map's handle), layer (The layer's number, from tmAddLayer or tmGetLayer), x (The tile column, from 0), y (The tile row, from 0), terrain (The terrain number from tmSetTerrain, or 0 to empty the cell). Returns nothing.

Technical Exegesis...

Sets a cell to a terrain, or empties it, then picks the right tile for it and its 8 neighbours. Neighbours that aren't this terrain are left alone, and the edge of the map counts as the same terrain.

See the Tilemaps guide.

Returns nothing.

Example

Example.bam
tmSetTileAuto(map, ground, x, y, 1)