tmWorldToTileX

Category: Tilemap — Queries

Syntax:

tmWorldToTileX:Int(map:Int, worldX:Int)


Parameters

Returns

The column. It can be outside the map.



Summary

Turns an x position into a tile column on a square map. On an isometric map it takes a grid x. For a world position on those maps, use tmTileXAt.

See the Tilemaps guide.



Example
cx = tmWorldToTileX(map, camX + inpGetMouseX())

BambooBasic © 2026 Michael Denathorn