diff options
| author | Rémi Verschelde | 2018-06-26 20:57:39 +0200 |
|---|---|---|
| committer | GitHub | 2018-06-26 20:57:39 +0200 |
| commit | f036353b93269e1162437f188f6792f3953ac155 (patch) | |
| tree | d07d0dea2a5fd07b62a1bade2235ede65e795483 /scene | |
| parent | c8617565d84d69b1966878debe61b4c712750780 (diff) | |
| parent | cadd72793b8d9c21d0b70bdef6427125fd008a40 (diff) | |
| download | godot-f036353b93269e1162437f188f6792f3953ac155.tar.gz godot-f036353b93269e1162437f188f6792f3953ac155.tar.zst godot-f036353b93269e1162437f188f6792f3953ac155.zip | |
Diffstat (limited to 'scene')
| -rw-r--r-- | scene/2d/tile_map.cpp | 6 | ||||
| -rw-r--r-- | scene/2d/tile_map.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 7fb4e36b6..1d6003728 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -730,6 +730,11 @@ void TileMap::set_cellv(const Vector2 &p_pos, int p_tile, bool p_flip_x, bool p_ set_cell(p_pos.x, p_pos.y, p_tile, p_flip_x, p_flip_y, p_transpose); } +void TileMap::set_celld(const Vector2 &p_pos, const Dictionary &p_data) { + + set_cell(p_pos.x, p_pos.y, p_data["id"], p_data["flip_h"], p_data["flip_y"], p_data["transpose"], p_data["auto_coord"]); +} + void TileMap::set_cell(int p_x, int p_y, int p_tile, bool p_flip_x, bool p_flip_y, bool p_transpose, Vector2 p_autotile_coord) { PosKey pk(p_x, p_y); @@ -1616,6 +1621,7 @@ void TileMap::_bind_methods() { ClassDB::bind_method(D_METHOD("set_cell", "x", "y", "tile", "flip_x", "flip_y", "transpose", "autotile_coord"), &TileMap::set_cell, DEFVAL(false), DEFVAL(false), DEFVAL(false), DEFVAL(Vector2())); ClassDB::bind_method(D_METHOD("set_cellv", "position", "tile", "flip_x", "flip_y", "transpose"), &TileMap::set_cellv, DEFVAL(false), DEFVAL(false), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("set_celld", "data"), &TileMap::set_celld); ClassDB::bind_method(D_METHOD("get_cell", "x", "y"), &TileMap::get_cell); ClassDB::bind_method(D_METHOD("get_cellv", "position"), &TileMap::get_cellv); ClassDB::bind_method(D_METHOD("is_cell_x_flipped", "x", "y"), &TileMap::is_cell_x_flipped); diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index d6774d42b..3ddb143f4 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -241,6 +241,7 @@ public: void set_cell_autotile_coord(int p_x, int p_y, const Vector2 &p_coord); Vector2 get_cell_autotile_coord(int p_x, int p_y) const; + void set_celld(const Vector2 &p_pos, const Dictionary &p_data); void set_cellv(const Vector2 &p_pos, int p_tile, bool p_flip_x = false, bool p_flip_y = false, bool p_transpose = false); int get_cellv(const Vector2 &p_pos) const; |
