forEachCell

inline fun TiledMapTileLayer.forEachCell(action: (cell: TiledMapTileLayer.Cell, cellX: Int, cellY: Int) -> Unit)

Extension method to easily execute an action per Cell of a TiledMapTileLayer. The action takes the Cell as well as its cell coordinates as parameters. Cells without a tile (i.e. null cells) are skipped.


inline fun TiledMap.forEachCell(action: (layer: TiledMapTileLayer, cell: TiledMapTileLayer.Cell, cellX: Int, cellY: Int) -> Unit)

Extension method to easily execute an action per Cell of every TiledMapTileLayer of the TiledMap. The action takes the TiledMapTileLayer the Cell belongs to, the Cell as well as its cell coordinates as parameters. Cells without a tile (i.e. null cells) are skipped.

Parameters

action

action to execute per non-empty Cell of every TiledMapTileLayer. The layer the Cell belongs to is passed as the layer parameter, cell coordinates as the cellX and cellY parameters.