Method CreateLayer
CreateLayer(string, Tileset, int, int, Vector2)
Creates a new TilemapLayer element and adds it to this Tilemap.
public TilemapLayer CreateLayer(string layerName, Tileset tileset, int columns, int rows, Vector2 offset)
Parameters
layerNamestringThe name to give the TilemapLayer element created by this method. The name must be unique across all TilemapLayer elements in this Tilemap.
tilesetTilesetThe source tileset to assign the TilemapLayer element created by this method.
columnsintThe total number of columns to assign the TilemapLayer element created by this method.
rowsintThe total of rows to assign the TilemapLayer element created by this method.
offsetVector2The x- and y-position offset, relative to the location the Tilemap is rendered, to assign the TilemapLayer element created by this method.
Returns
- TilemapLayer
The TilemapLayer created by this method.
Exceptions
- InvalidOperationException
Thrown if this Tilemap already contains a TilemapLayer element with the specified name.