Skip to content

Tilemap Class

Definition

Namespace: Brine2D.Tilemap

Represents a tilemap with multiple layers and a tileset. Pure data structure - rendering is handled by TilemapRenderer extension.

C#
public class Tilemap

Inheritance System.Object → Tilemap

Properties
Height Height of the tilemap in tiles.
Layers Layers in the tilemap \(background, gameplay, foreground, etc\.\).
TileHeight Height of each tile in pixels.
Tileset Tileset used by this tilemap.
TileWidth Width of each tile in pixels.
Width Width of the tilemap in tiles.
Methods
AddLayer\(TilemapLayer\) Adds a layer to the tilemap.
GenerateCollisionRects\(string\) Returns world-space rectangles for all solid tiles in the specified layer. Use these to create static collider entities in your scene.
GetLayer\(string\) Gets a layer by name.