tmObjectCount

Category: Tilemap — Objects

Syntax:

tmObjectCount:Int(map:Int, layerName:String)


Parameters

Returns

The number of objects, 0 if there is no such layer.



Summary

Counts the objects in one of Tiled's object layers.

See the Tilemaps guide.



Example
For i:Int = 0 To tmObjectCount(map, "things") - 1
    Spawn(tmObjectType(map, "things", i), tmObjectX(map, "things", i), tmObjectY(map, "things", i))
Next

BambooBasic © 2026 Michael Denathorn