Is it possible to get the id of a layer of a TileMap by his name alone ? Doing by id is not ideal since I may change the layer ordering at a certain point, and the ids will also change, but the tiles will remain. So if a decoration layer is swapped (in layers) with a effect position the effects will remove the tiles.
We have the function void set_layer_name(layer: int, name: String)
and get_layer but those are not really useful currently
I did this as a little hack, since I don't add/move layers:
var layers_dict = {}
func _ready():
set_layers()
func set_layers():
for layer_id in range(self.get_layers_count()):
var layer_name = self.get_layer_name(layer_id)
layers_dict[layer_name] = layer_id
But this is just a little hack, am I missing something or should it be implemented in godot ?