summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPatrick Reh <musicmylove@gmx.net>2016-06-18 00:01:00 +0200
committerpatrick <musicmylove@gmx.net>2016-06-20 12:18:53 +0200
commitfff4d5867ce8ae69cd5699a55f7617edb3015f0f (patch)
treef0b927982eb1ada8b6796f58e027dc09f14dd6a0 /tools
parenta1a57bc369de01cbb2295b403d84ec5fac210020 (diff)
Added Tile Origin = Bottom Left option to the TileMap
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/plugins/tile_map_editor_plugin.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp
index d5f85d3333..ef15184f40 100644
--- a/tools/editor/plugins/tile_map_editor_plugin.cpp
+++ b/tools/editor/plugins/tile_map_editor_plugin.cpp
@@ -412,6 +412,24 @@ void TileMapEditor::_draw_cell(int p_cell, const Point2i& p_point, bool p_flip_h
if (node->get_tile_origin()==TileMap::TILE_ORIGIN_TOP_LEFT) {
rect.pos+=tile_ofs;
+ } else if (node->get_tile_origin()==TileMap::TILE_ORIGIN_BOTTOM_LEFT) {
+ Size2 cell_size = node->get_cell_size();
+
+ rect.pos+=tile_ofs;
+
+ if(p_transpose)
+ {
+ if(p_flip_h)
+ rect.pos.x-=cell_size.x;
+ else
+ rect.pos.x+=cell_size.x;
+ } else {
+ if(p_flip_v)
+ rect.pos.y-=cell_size.y;
+ else
+ rect.pos.y+=cell_size.y;
+ }
+
} else if (node->get_tile_origin()==TileMap::TILE_ORIGIN_CENTER) {
rect.pos+=node->get_cell_size()/2;
Vector2 s = r.size;