tmProbe

Category: Tilemap

Syntax:

tmProbe:Int(map:Int, layer:Int, x:Double, y:Double, dirX:Double, dirY:Double, from:Int, reach:Int, flags:Int)


Parameters

Returns

Int



Summary

Walks along a direction a pixel at a time for the first solid pixel. On an isometric map it works in grid pixels, and on staggered and hexagonal maps it returns 0. tmHitDistance gives how far it was from the point.

Takes map (The map's handle), layer (The layer's number, from tmAddLayer or tmGetLayer), x (The start x, in world pixels), y (The start y, in world pixels), dirX (The direction, x part. Give a direction of length 1), dirY (The direction, y part), from (How far along to start looking, in pixels), reach (How far along to stop, in pixels), flags (The flag bits to look for. 0 means any tile that isn't empty).

Returns: 1 if it finds one, otherwise 0.

View detailed documentation online



Example
If tmProbe(map, ground, x, y, 1.0, 0.0, 1, 12, 1) Then x = x - (12 - tmHitDistance())

BambooBasic © 2026 Michael Denathorn