Skip to content

Commit

Permalink
Tweak tile atlas help label positions
Browse files Browse the repository at this point in the history
  • Loading branch information
KoBeWi committed Jan 1, 2024
1 parent 13a0d6e commit 3058a49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions editor/plugins/tiles/tile_set_atlas_source_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2644,18 +2644,21 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
tile_atlas_view->connect("transform_changed", callable_mp(this, &TileSetAtlasSourceEditor::_tile_atlas_view_transform_changed).unbind(2));
right_panel->add_child(tile_atlas_view);

tile_create_help = memnew(HBoxContainer);
tile_create_help = memnew(VBoxContainer);
tile_atlas_view->add_child(tile_create_help);
tile_create_help->set_mouse_filter(MOUSE_FILTER_IGNORE);
tile_create_help->set_anchors_and_offsets_preset(Control::PRESET_BOTTOM_LEFT, Control::PRESET_MODE_MINSIZE, 30 * EDSCALE);
tile_create_help->add_theme_constant_override("separation", 30 * EDSCALE);

Label *help_label = memnew(Label(TTR("Hold Ctrl to create multiple tiles.")));
tile_create_help->add_child(help_label);

help_label = memnew(Label(TTR("Hold Shift to create big tiles.")));
tile_create_help->add_child(help_label);

tile_create_help->set_anchors_and_offsets_preset(Control::PRESET_BOTTOM_LEFT, Control::PRESET_MODE_MINSIZE);
Vector2 pos = tile_create_help->get_position();
pos.y -= 8 * EDSCALE;
tile_create_help->set_position(pos);

base_tile_popup_menu = memnew(PopupMenu);
base_tile_popup_menu->add_shortcut(ED_SHORTCUT("tiles_editor/delete", TTR("Delete"), Key::KEY_DELETE), TILE_DELETE);
base_tile_popup_menu->add_item(TTR("Create an Alternative Tile"), TILE_CREATE_ALTERNATIVE);
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/tiles/tile_set_atlas_source_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class TileSetAtlasSourceEditor : public HSplitContainer {

// -- Atlas view --
TileAtlasView *tile_atlas_view = nullptr;
HBoxContainer *tile_create_help = nullptr;
VBoxContainer *tile_create_help = nullptr;

// Dragging
enum DragType {
Expand Down

0 comments on commit 3058a49

Please sign in to comment.