aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/plugins/tile_map_editor_plugin.cpp
diff options
context:
space:
mode:
authorMark Nokalt2016-06-16 21:10:44 -0300
committerRémi Verschelde2016-09-01 08:46:23 +0200
commita3a065b458da84ee1335b0f1f29d84ad7d5491f3 (patch)
tree2082c5e316e8a112a7d1d189d29567630009eabd /tools/editor/plugins/tile_map_editor_plugin.cpp
parent9ea76ff46daa428cb50715697732c173dbf994c4 (diff)
downloadgodot-a3a065b458da84ee1335b0f1f29d84ad7d5491f3.tar.gz
godot-a3a065b458da84ee1335b0f1f29d84ad7d5491f3.tar.zst
godot-a3a065b458da84ee1335b0f1f29d84ad7d5491f3.zip
editor: Add mouse position information in TileMap
(cherry picked from commit cd71fcb097b28a1602e34c7167cc4b4c3fc628c7)
Diffstat (limited to 'tools/editor/plugins/tile_map_editor_plugin.cpp')
-rw-r--r--tools/editor/plugins/tile_map_editor_plugin.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp
index 316077c5d..822d9e6c8 100644
--- a/tools/editor/plugins/tile_map_editor_plugin.cpp
+++ b/tools/editor/plugins/tile_map_editor_plugin.cpp
@@ -798,6 +798,13 @@ bool TileMapEditor::forward_input_event(const InputEvent& p_event) {
canvas_item_editor->update();
}
+ int tile_under = node->get_cell(over_tile.x, over_tile.y);
+ String tile_name = "none";
+
+ if (node->get_tileset()->has_tile(tile_under))
+ tile_name = node->get_tileset()->tile_get_name(tile_under);
+ tile_info->set_text(String::num(over_tile.x)+", "+String::num(over_tile.y)+" ["+tile_name+"]");
+
if (tool==TOOL_PAINTING) {
int id = get_selected_tile();
@@ -1370,6 +1377,10 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) {
toolbar->set_alignment(BoxContainer::ALIGN_END);
CanvasItemEditor::get_singleton()->add_control_to_menu_panel(toolbar);
+ // Tile position
+ tile_info = memnew( Label );
+ toolbar->add_child(tile_info);
+
options = memnew( MenuButton );
options->set_text("Tile Map");
options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("TileMap", "EditorIcons"));