auto grid = [ [ 00, 01, 02, 03, 04, ], [ 10, 11, 12, 13, 14, ], [ 20, 21, 22, 23, 24, ], ]; auto map = OrthoMap!int(grid, 32, 32); assert(map.tileAtPoint(PixelCoord( 0, 0)) == 00); // corner of top left tile assert(map.tileAtPoint(PixelCoord( 16, 30)) == 00); // inside top left tile assert(map.tileAtPoint(PixelCoord(149, 95)) == 24); // inside bottom right tile
Get the tile at a given pixel position on the map. Throws if out of bounds.