diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2016-02-07 00:33:43 +0100 |
|---|---|---|
| committer | Rémi Verschelde <remi@verschelde.fr> | 2016-02-07 00:33:43 +0100 |
| commit | 4a39202c8d162d1e8b7d389fdcb75b51323d2d7d (patch) | |
| tree | f725b5966fc9e77b76908d88979a264a32502c2d /scene/2d/tile_map.cpp | |
| parent | 3ee4f4f19a3e3a63450f0b3bc612c01f44edba19 (diff) | |
| parent | a634fc7a4a4a413666569d5c26562d5ee982ba3f (diff) | |
Merge pull request #3607 from 29jm/patch-1
Added get_cellv() method to TileMap
Diffstat (limited to 'scene/2d/tile_map.cpp')
| -rw-r--r-- | scene/2d/tile_map.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 179d1f451a..5c298e96f6 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -694,6 +694,10 @@ void TileMap::set_cell(int p_x,int p_y,int p_tile,bool p_flip_x,bool p_flip_y,bo } +int TileMap::get_cellv(const Vector2& p_pos) const { + return get_cell(p_pos.x,p_pos.y); +} + int TileMap::get_cell(int p_x,int p_y) const { PosKey pk(p_x,p_y); @@ -1198,6 +1202,7 @@ void TileMap::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_cell","x","y","tile","flip_x","flip_y","transpose"),&TileMap::set_cell,DEFVAL(false),DEFVAL(false),DEFVAL(false)); ObjectTypeDB::bind_method(_MD("set_cellv","pos","tile","flip_x","flip_y","transpose"),&TileMap::set_cellv,DEFVAL(false),DEFVAL(false),DEFVAL(false)); ObjectTypeDB::bind_method(_MD("get_cell","x","y"),&TileMap::get_cell); + ObjectTypeDB::bind_method(_MD("get_cellv","pos"),&TileMap::get_cellv); ObjectTypeDB::bind_method(_MD("is_cell_x_flipped","x","y"),&TileMap::is_cell_x_flipped); ObjectTypeDB::bind_method(_MD("is_cell_y_flipped","x","y"),&TileMap::is_cell_y_flipped); |