tmBoxHit

Category: Tilemap

Syntax:

tmBoxHit:Int(map:Int, layer:Int, x:Int, y:Int, w:Int, h:Int, flags:Int)


Parameters

Returns

Int



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.

View detailed documentation online



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

BambooBasic © 2026 Michael Denathorn