Table of Contents

Class TilemapRenderer

Namespace
PopcorningGuineaPig.Engine.Services
Assembly
PopcorningGuineaPig.Engine.dll

Service for rendering tilemaps using Raylib-cs. Provides efficient tilemap rendering with layer support and view culling.

public class TilemapRenderer
Inheritance
TilemapRenderer
Inherited Members

Methods

RenderDebugInfo(Tilemap, Vector2, bool, bool)

Renders debug information for a tilemap. Shows tile bounds, layer information, and tileset data.

public void RenderDebugInfo(Tilemap tilemap, Vector2 position = default, bool showTileBounds = true, bool showLayerInfo = true)

Parameters

tilemap Tilemap

Tilemap to debug

position Vector2

World position offset

showTileBounds bool

Whether to show individual tile boundaries

showLayerInfo bool

Whether to show layer information

RenderLayer(Tilemap, TilemapLayer, int, Vector2, Rectangle?)

Renders a specific layer of a tilemap.

public void RenderLayer(Tilemap tilemap, TilemapLayer layer, int layerIndex, Vector2 position = default, Rectangle? viewBounds = null)

Parameters

tilemap Tilemap

Tilemap containing the layer

layer TilemapLayer

Layer to render

layerIndex int

Index of the layer

position Vector2

World position offset

viewBounds Rectangle?

Optional view bounds for culling

RenderTile(Tilemap, int, int, int, Vector2, float)

Renders a single tile at the specified grid coordinates.

public void RenderTile(Tilemap tilemap, int tileId, int gridX, int gridY, Vector2 position, float opacity = 1)

Parameters

tilemap Tilemap

Tilemap containing the tile

tileId int

Global tile ID

gridX int

Grid X coordinate

gridY int

Grid Y coordinate

position Vector2

World position offset

opacity float

Layer opacity

RenderTileGridOverlay(TileGrid, Color)

Renders a tile grid overlay for a tilemap layer. Useful for visualizing the GameTile integration.

public void RenderTileGridOverlay(TileGrid tileGrid, Color color)

Parameters

tileGrid TileGrid

TileGrid to overlay

color Color

Color for the grid lines

RenderTilemap(Tilemap, Vector2, Camera2D?)

Renders a complete tilemap with all visible layers.

public void RenderTilemap(Tilemap tilemap, Vector2 position = default, Camera2D? camera = null)

Parameters

tilemap Tilemap

Tilemap to render

position Vector2

World position offset for the tilemap

camera Camera2D?

Optional camera for view culling

RenderTilemapWithTransform(Tilemap, Matrix4x4, Camera2D?)

Renders a tilemap with a specific transform matrix. Useful for advanced rendering scenarios.

public void RenderTilemapWithTransform(Tilemap tilemap, Matrix4x4 transform, Camera2D? camera = null)

Parameters

tilemap Tilemap

Tilemap to render

transform Matrix4x4

Transform matrix

camera Camera2D?

Optional camera for view culling