tmObjectCount

Category: Tilemap

Syntax:

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


Parameters

Returns

Int



Summary

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

Takes map (The map's handle), layerName (The name of the object layer in Tiled).

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

View detailed documentation online



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