draw

abstract 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.

abstract 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)

abstract 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

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

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

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

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