draw

override fun draw(tileMap: Map<Position, Tile>, drawPosition: Position, drawArea: Size)

Draws the given tileMap onto this TileGraphics. If the tileMap has Tiles which are not contained within the size of this TileGraphics they will be ignored.

Parameters

tileMap

Position -> Tile mappings which contains the Tiles to draw. the Positions will be offset with drawPosition when drawing

drawPosition

the starting position of the drawing relative to the top left corner of this TileGraphics. The default is Positions.zero.

drawArea

the sub-section of the tileMap to which the Tiles should be drawn Example: If this DrawSurface has the size of (3,3), drawPosition is (1,1) and drawArea is (2,2) the following positions will be overwritten: (1,1), (2,1), (1,2), (2,2)

override fun draw(tile: Tile, drawPosition: Position)

Draws the given Tile on this TileGraphics at the given drawPosition. Drawing the empty tile (Tile.empty) will result in the deletion of the Tile at drawPosition.

override fun draw(tileComposite: TileComposite)
override fun draw(tileComposite: TileComposite, drawPosition: Position)
override fun draw(tileComposite: TileComposite, drawPosition: Position, drawArea: Size)

Same as draw with tileMap, but TileComposite.tiles will be use as the Map.

override fun draw(tileMap: Map<Position, Tile>)

Same as draw with 3 parameters, with the difference that size will be used for drawArea, and Position.zero as drawPosition

override fun draw(tileMap: Map<Position, Tile>, drawPosition: Position)

Same as draw with 3 parameters, with the difference that size will be used for drawArea.