Method CreateLayer
CreateLayer(string, Tileset, int, int, Vector2)
Creates a new Tilemap
public TilemapLayer CreateLayer(string layerName, Tileset tileset, int columns, int rows, Vector2 offset)
Parameters
layerName
stringThe name to give the Tilemap
Layer element created by this method. The name must be unique across all TilemapLayer elements in this Tilemap.tileset
TilesetThe source tileset to assign the Tilemap
Layer element created by this method.columns
intThe total number of columns to assign the Tilemap
Layer element created by this method.rows
intThe total of rows to assign the Tilemap
Layer element created by this method.offset
Vector2The x- and y-position offset, relative to the location the Tilemap is rendered, to assign the Tilemap
Layer element created by this method.
Returns
- Tilemap
Layer The Tilemap
Layer created by this method.
Exceptions
- Invalid
Operation Exception Thrown if this Tilemap already contains a Tilemap
Layer element with the specified name.