OrthoMap.containsPoint

True if the pixel position is within the map bounds.

struct OrthoMap(Tile)
bool
containsPoint
(
T
)
(
T pos
)

Examples

// 3x5 map, pixel bounds are [0, 0, 160, 96] (32*3 = 96, 32*5 = 160)
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.containsPoint(PixelCoord(   0,    0))); // top left
assert( map.containsPoint(PixelCoord( 159,   95))); // bottom right
assert( map.containsPoint(PixelCoord(  80,   48))); // center
assert(!map.containsPoint(PixelCoord(   0,   96))); // beyond right border
assert(!map.containsPoint(PixelCoord( 160,    0))); // beyond bottom border
assert(!map.containsPoint(PixelCoord(   0, -0.5))); // beyond left border
assert(!map.containsPoint(PixelCoord(-0.5,    0))); // beyond top border

Meta