mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 10:31:15 +00:00
editor: Add mouse position information in TileMap
This commit is contained in:
parent
61cb8fd76c
commit
cd71fcb097
2 changed files with 13 additions and 0 deletions
|
|
@ -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"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue