tmObjectCount

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.

Tilemap

Parameters & Returns

Parameters

map Int
layerName String

Returns

Int

Quick 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.

Technical Exegesis...

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

See the Tilemaps guide.

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

Example

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