summaryrefslogtreecommitdiffstats
path: root/scene/resources/tile_set.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-02-20 23:02:47 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-02-20 23:02:47 -0300
commitb62ec387f340220e11902daab8484fcb85d28cda (patch)
treefd62ea164cd1cb5a656df529f554ed8d4bf3301b /scene/resources/tile_set.cpp
parentf2a068984c36de1f77940ae9d5dc0d017b8e642d (diff)
parent287a6347e66e530350f09f3d66b3ef8e7e868a0b (diff)
downloadredot-engine-b62ec387f340220e11902daab8484fcb85d28cda.tar.gz
Merge branch 'master' of https://github.com/okamstudio/godot
Diffstat (limited to 'scene/resources/tile_set.cpp')
-rw-r--r--scene/resources/tile_set.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index c85b470325..208ba5bb66 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -250,6 +250,17 @@ Array TileSet::_tile_get_shapes(int p_id) const{
return arr;
}
+Array TileSet::_get_tiles_ids() const{
+
+ Array arr;
+
+ for (Map<int, Data>::Element *E = tile_map.front(); E; E = E->next()) {
+ arr.push_back(E->key());
+ }
+
+ return arr;
+}
+
void TileSet::get_tile_list(List<int> *p_tiles) const {
for(Map<int,Data>::Element *E=tile_map.front();E;E=E->next()) {
@@ -322,6 +333,7 @@ void TileSet::_bind_methods() {
ObjectTypeDB::bind_method(_MD("clear"),&TileSet::clear);
ObjectTypeDB::bind_method(_MD("get_last_unused_tile_id"),&TileSet::get_last_unused_tile_id);
ObjectTypeDB::bind_method(_MD("find_tile_by_name","name"),&TileSet::find_tile_by_name);
+ ObjectTypeDB::bind_method(_MD("get_tiles_ids", "name"), &TileSet::_get_tiles_ids);
}