forEachMapObject

inline fun TiledMap.forEachMapObject(layerName: String, action: (MapObject) -> Unit)

Extension method to easily execute an action per MapObject of a given MapLayer. If the layer does not exist then nothing is happening.

Parameters

layerName

name of MapLayer

action

action to execute per MapObject of the MapLayer