OrthoMap.tileCenter

Get the pixel offset of the center of the tile at the given coord.

struct OrthoMap(Tile)
tileCenter

Parameters

coord RowCol

grid location of tile.

Examples

// 2 rows, 3 cols, 32x64 tiles
auto grid = [
  [ 00, 01, 02, ],
  [ 10, 11, 12, ],
];
auto myMap = OrthoMap!int(grid, 32, 64);

assert(myMap.tileCenter(RowCol(0, 0)) == PixelCoord(16, 32));
assert(myMap.tileCenter(RowCol(1, 2)) == PixelCoord(80, 96));

Meta