PhysicsAPI reference
Class TileRenderer
Namespace: MicroEngine.World
Assembly: MicroEngine.dll
Guide: Tile maps and collision
Draws the visible part of a layer, asking the game which sprite each tile uses.
public static class TileRendererInheritance
Methods
Draw(IRenderer, TileLayer, int, Camera2D?, Func<int, int, int, Sprite?>)
Draws the non-zero tiles that can be seen, each at its tile position minus its sprite’s origin.
public static void Draw(IRenderer renderer, TileLayer layer, int tileSize, Camera2D? camera, Func<int, int, int, Sprite?> spriteFor)Parameters
renderer IRenderer
The renderer; push camera on it first when there is one.
layer TileLayer
The tile ids; 0 is never drawn.
tileSize int
Tile size in pixels.
camera Camera2D?
The camera, used only to skip tiles outside its view; null draws the tiles over the screen area.
spriteFor Func<int, int, int, Sprite?>
Returns the sprite for a tile id at tile (x, y), or null to draw nothing.