Skip to content

TilemapRenderer Class

Definition

Namespace: Brine2D.Rendering

Handles rendering of tilemaps with sprite batching. Separates rendering from core tilemap data. Uses SpriteBatcher for optimal performance.

C#
public class TilemapRenderer

Inheritance System.Object → TilemapRenderer

Methods
GetBatchStats() Gets batching statistics for tilemaps.
GetVisibleTileRange\(Tilemap, ICamera\) Calculates which tiles are visible based on camera position. Uses frustum culling to skip off-screen tiles.
LoadTilesetAsync\(Tilemap, ITextureLoader, CancellationToken\) Loads the tileset texture for a tilemap.
Render\(Tilemap, IRenderer, ICamera\) Renders a tilemap using sprite batching and frustum culling. All tiles are batched together for maximum performance.
UnloadAll\(ITextureLoader\) Unloads all loaded tileset textures.