Types
TileMapObj = object of Node2DObj mode*: TileMapMode map_size*: tuple[x, y, z: int] tileset*: TileSetObj map*: seq[ref Vector2Obj]
TileMapRef = ref TileMapObj
Procs
proc TileMap(name: string = "TileMap"): TileMapRef {...}{.raises: [], tags: [].}
-
Creates a new TileMap object.
Example:
var mytilemap = TileMap("MyTileMap")
Methods
method draw(self: TileMapRef; w, h: GLfloat) {...}{.raises: [GLerror], tags: [].}
- this method uses in the window.nim.
method drawTile(self: TileMapRef; x, y: int; tile_pos: Vector2Obj; layer: int = 0) {...}{.base, raises: [], tags: [].}
- Changes map tile at x,`y` point to tile from tileset at tile_pos point.
method drawRect(self: TileMapRef; x, y, w, h: int; tile_pos: Vector2Obj; layer: int = 0) {...}{.base, raises: [], tags: [].}
method fill(self: TileMapRef; tile_pos: Vector2Obj; layer: int = 0) {...}{.base, raises: [], tags: [].}
- Fills the map with a tile at tile_pos position.
method resizeMap(self: TileMapRef; size: Vector2Obj; layer_count: int = 2) {...}{. base, raises: [], tags: [].}
- Changes map size to size.
method setMode(self: TileMapRef; mode: TileMapMode) {...}{.base, raises: [], tags: [].}
- Changes drawing mode.
method setTileSet(self: TileMapRef; tileset: TileSetObj) {...}{.base, raises: [], tags: [].}
- Changes current tileset.