Class TilemapRenderer
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
tilemapTilemapTilemap to debug
positionVector2World position offset
showTileBoundsboolWhether to show individual tile boundaries
showLayerInfoboolWhether 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
tilemapTilemapTilemap containing the layer
layerTilemapLayerLayer to render
layerIndexintIndex of the layer
positionVector2World position offset
viewBoundsRectangle?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
tilemapTilemapTilemap containing the tile
tileIdintGlobal tile ID
gridXintGrid X coordinate
gridYintGrid Y coordinate
positionVector2World position offset
opacityfloatLayer 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
tileGridTileGridTileGrid to overlay
colorColorColor 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
tilemapTilemapTilemap to render
positionVector2World position offset for the tilemap
cameraCamera2D?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)