1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-12-25 01:39:23 +01:00

add a tiled method to get the index of a layer

This commit is contained in:
Ellpeck 2019-12-07 12:56:01 +01:00
parent 7952ba1582
commit 3298608141

View file

@ -52,6 +52,11 @@ namespace MLEM.Extended.Tiled {
return tileset?.GetTilesetTile(tile, map);
}
public static int GetTileLayerIndex(this TiledMap map, string layerName) {
var layer = map.GetLayer<TiledMapTileLayer>(layerName);
return map.TileLayers.IndexOf(layer);
}
public static TiledMapTile GetTile(this TiledMap map, string layerName, int x, int y) {
var layer = map.GetLayer<TiledMapTileLayer>(layerName);
return layer != null ? layer.GetTile(x, y) : default;