tmBoxHit

Asks if a box in the world touches a tile with these flags, respecting tile shapes and flips. On an isometric map the box is in grid pixels, and on staggered and hexagonal maps this returns 0. tmHitX, tmHitY, tmHitTile, tmHitWorldX and tmHitWorldY give the details. Takes map (The map's handle), layer (The layer's number, from tmAddLayer or tmGetLayer), x (The left of the box, in world pixels), y (The top of the box, in world pixels), w (The width, in pixels), h (The height, in pixels), flags (The flag bits to look for. 0 means any tile that isn't empty). Returns: 1 if it hits, otherwise 0.

Tilemap

Parameters & Returns

Parameters

map Int
layer Int
x Int
y Int
w Int
h Int
flags Int

Returns

Int

Quick Summary

Asks if a box in the world touches a tile with these flags, respecting tile shapes and flips. On an isometric map the box is in grid pixels, and on staggered and hexagonal maps this returns 0. tmHitX, tmHitY, tmHitTile, tmHitWorldX and tmHitWorldY give the details. Takes map (The map's handle), layer (The layer's number, from tmAddLayer or tmGetLayer), x (The left of the box, in world pixels), y (The top of the box, in world pixels), w (The width, in pixels), h (The height, in pixels), flags (The flag bits to look for. 0 means any tile that isn't empty). Returns: 1 if it hits, otherwise 0.

Technical Exegesis...

Asks if a box in the world touches a tile with these flags, respecting tile shapes and flips. On an isometric map the box is in grid pixels, and on staggered and hexagonal maps this returns 0. tmHitX, tmHitY, tmHitTile, tmHitWorldX and tmHitWorldY give the details.

See the Tilemaps guide.

Returns: 1 if it hits, otherwise 0.

Example

Example.bam
If tmBoxHit(map, ground, px, py + 1, 16, 16, 1) Then onGround = True