mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-27 22:27:15 +01:00
Added a get_layer() helper method to the LayeredTileMap.
This commit is contained in:
parent
fd5be3f26c
commit
aa82d20e4b
@ -447,6 +447,12 @@ void LayeredTileMap::remove_layer(int p_layer) {
|
|||||||
update_configuration_warning();
|
update_configuration_warning();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LayeredTileMapLayer *LayeredTileMap::get_layer(const int p_layer) const {
|
||||||
|
ERR_FAIL_INDEX_V(p_layer, (int)layers.size(), NULL);
|
||||||
|
|
||||||
|
return layers[p_layer];
|
||||||
|
}
|
||||||
|
|
||||||
void LayeredTileMap::set_layer_name(int p_layer, String p_name) {
|
void LayeredTileMap::set_layer_name(int p_layer, String p_name) {
|
||||||
TILEMAP_CALL_FOR_LAYER(p_layer, set_name, p_name);
|
TILEMAP_CALL_FOR_LAYER(p_layer, set_name, p_name);
|
||||||
}
|
}
|
||||||
@ -1277,6 +1283,8 @@ void LayeredTileMap::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("add_layer", "to_position"), &LayeredTileMap::add_layer);
|
ClassDB::bind_method(D_METHOD("add_layer", "to_position"), &LayeredTileMap::add_layer);
|
||||||
ClassDB::bind_method(D_METHOD("move_layer", "layer", "to_position"), &LayeredTileMap::move_layer);
|
ClassDB::bind_method(D_METHOD("move_layer", "layer", "to_position"), &LayeredTileMap::move_layer);
|
||||||
ClassDB::bind_method(D_METHOD("remove_layer", "layer"), &LayeredTileMap::remove_layer);
|
ClassDB::bind_method(D_METHOD("remove_layer", "layer"), &LayeredTileMap::remove_layer);
|
||||||
|
ClassDB::bind_method(D_METHOD("get_layer", "layer"), &LayeredTileMap::get_layer);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("set_layer_name", "layer", "name"), &LayeredTileMap::set_layer_name);
|
ClassDB::bind_method(D_METHOD("set_layer_name", "layer", "name"), &LayeredTileMap::set_layer_name);
|
||||||
ClassDB::bind_method(D_METHOD("get_layer_name", "layer"), &LayeredTileMap::get_layer_name);
|
ClassDB::bind_method(D_METHOD("get_layer_name", "layer"), &LayeredTileMap::get_layer_name);
|
||||||
ClassDB::bind_method(D_METHOD("set_layer_enabled", "layer", "enabled"), &LayeredTileMap::set_layer_enabled);
|
ClassDB::bind_method(D_METHOD("set_layer_enabled", "layer", "enabled"), &LayeredTileMap::set_layer_enabled);
|
||||||
|
@ -142,6 +142,7 @@ public:
|
|||||||
void add_layer(int p_to_pos);
|
void add_layer(int p_to_pos);
|
||||||
void move_layer(int p_layer, int p_to_pos);
|
void move_layer(int p_layer, int p_to_pos);
|
||||||
void remove_layer(int p_layer);
|
void remove_layer(int p_layer);
|
||||||
|
LayeredTileMapLayer *get_layer(const int p_layer) const;
|
||||||
|
|
||||||
void set_layer_name(int p_layer, String p_name);
|
void set_layer_name(int p_layer, String p_name);
|
||||||
String get_layer_name(int p_layer) const;
|
String get_layer_name(int p_layer) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user