Skip to content

Tileset Class

Definition

Namespace: Brine2D.Tilemap

C#
public class Tileset

Inheritance System.Object → Tileset

Properties
Animations Tile animations keyed by GID. Only tiles with animations in Tiled are present.
Columns Number of tile columns in the sheet. 0 for image-collection tilesets \(not supported\).
FirstGid First GID — the offset Tiled applies when this tileset appears in a multi-tileset map.
Margin Pixel inset from the image edge to the first tile.
Spacing Pixel gap between adjacent tiles in the sheet. Prevents texture bleeding on non-power-of-two tiles.
TileProperties Per-tile properties keyed by GID. Only tiles with properties in Tiled are present.
Methods
GetTileSourceRect\(int\) Returns the source rect for a GID in the tileset texture, accounting for spacing and margin. Returns a zero rect for GID 0 or image-collection tilesets.