diff options
author | Nathan Franke <natfra@pm.me> | 2021-11-24 20:58:47 -0600 |
---|---|---|
committer | Nathan Franke <natfra@pm.me> | 2021-12-09 01:38:46 -0600 |
commit | 41a20171eb81a7850dd96ec31da4b40c619538a2 (patch) | |
tree | 64df686faeeca6068ba43167bf07fe8b3823e417 /editor/plugins/tiles | |
parent | f1e3c87244f18ab1a507b6e3637c34b2d49c1dc6 (diff) |
align to horizontal_alignment, valign to vertical_alignment, related
Diffstat (limited to 'editor/plugins/tiles')
-rw-r--r-- | editor/plugins/tiles/atlas_merging_dialog.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_atlas_view.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_data_editors.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_map_editor.cpp | 12 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_atlas_source_editor.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_editor.cpp | 6 |
6 files changed, 20 insertions, 20 deletions
diff --git a/editor/plugins/tiles/atlas_merging_dialog.cpp b/editor/plugins/tiles/atlas_merging_dialog.cpp index efccac7b74..e4a16274fe 100644 --- a/editor/plugins/tiles/atlas_merging_dialog.cpp +++ b/editor/plugins/tiles/atlas_merging_dialog.cpp @@ -309,8 +309,8 @@ AtlasMergingDialog::AtlasMergingDialog() { select_2_atlases_label = memnew(Label); select_2_atlases_label->set_h_size_flags(Control::SIZE_EXPAND_FILL); select_2_atlases_label->set_v_size_flags(Control::SIZE_EXPAND_FILL); - select_2_atlases_label->set_align(Label::ALIGN_CENTER); - select_2_atlases_label->set_valign(Label::VALIGN_CENTER); + select_2_atlases_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + select_2_atlases_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); select_2_atlases_label->set_text(TTR("Please select two atlases or more.")); atlas_merging_right_panel->add_child(select_2_atlases_label); diff --git a/editor/plugins/tiles/tile_atlas_view.cpp b/editor/plugins/tiles/tile_atlas_view.cpp index 604143ef93..6a3261cbee 100644 --- a/editor/plugins/tiles/tile_atlas_view.cpp +++ b/editor/plugins/tiles/tile_atlas_view.cpp @@ -616,7 +616,7 @@ TileAtlasView::TileAtlasView() { Label *base_tile_label = memnew(Label); base_tile_label->set_mouse_filter(Control::MOUSE_FILTER_PASS); base_tile_label->set_text(TTR("Base Tiles")); - base_tile_label->set_align(Label::ALIGN_CENTER); + base_tile_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); left_vbox->add_child(base_tile_label); base_tiles_root_control = memnew(Control); @@ -660,7 +660,7 @@ TileAtlasView::TileAtlasView() { Label *alternative_tiles_label = memnew(Label); alternative_tiles_label->set_mouse_filter(Control::MOUSE_FILTER_IGNORE); alternative_tiles_label->set_text(TTR("Alternative Tiles")); - alternative_tiles_label->set_align(Label::ALIGN_CENTER); + alternative_tiles_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); right_vbox->add_child(alternative_tiles_label); alternative_tiles_root_control = memnew(Control); diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp index 44cf6b42bc..5ded607ab5 100644 --- a/editor/plugins/tiles/tile_data_editors.cpp +++ b/editor/plugins/tiles/tile_data_editors.cpp @@ -218,7 +218,7 @@ void GenericTilePolygonEditor::_base_control_draw() { int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label")); String text = multiple_polygon_mode ? vformat("%d:%d", tinted_polygon_index, tinted_point_index) : vformat("%d", tinted_point_index); Size2 text_size = font->get_string_size(text, font_size); - base_control->draw_string(font, xform.xform(polygons[tinted_polygon_index][tinted_point_index]) - text_size * 0.5, text, HALIGN_LEFT, -1, font_size, Color(1.0, 1.0, 1.0, 0.5)); + base_control->draw_string(font, xform.xform(polygons[tinted_polygon_index][tinted_point_index]) - text_size * 0.5, text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1.0, 1.0, 1.0, 0.5)); } if (drag_type == DRAG_TYPE_CREATE_POINT) { @@ -1113,7 +1113,7 @@ void TileDataDefaultEditor::draw_over_tile(CanvasItem *p_canvas_item, Transform2 } Vector2 string_size = font->get_string_size(text, font_size); - p_canvas_item->draw_string(font, p_transform.get_origin() + Vector2i(-string_size.x / 2, string_size.y / 2), text, HALIGN_CENTER, string_size.x, font_size, color, 1, Color(0, 0, 0, 1)); + p_canvas_item->draw_string(font, p_transform.get_origin() + Vector2i(-string_size.x / 2, string_size.y / 2), text, HORIZONTAL_ALIGNMENT_CENTER, string_size.x, font_size, color, 1, Color(0, 0, 0, 1)); } } @@ -1700,7 +1700,7 @@ void TileDataTerrainsEditor::forward_draw_over_atlas(TileAtlasView *p_tile_atlas text = "-"; } Vector2 string_size = font->get_string_size(text, font_size); - p_canvas_item->draw_string(font, p_transform.xform(position) + Vector2i(-string_size.x / 2, string_size.y / 2), text, HALIGN_CENTER, string_size.x, font_size, color, 1, Color(0, 0, 0, 1)); + p_canvas_item->draw_string(font, p_transform.xform(position) + Vector2i(-string_size.x / 2, string_size.y / 2), text, HORIZONTAL_ALIGNMENT_CENTER, string_size.x, font_size, color, 1, Color(0, 0, 0, 1)); } } } @@ -1876,7 +1876,7 @@ void TileDataTerrainsEditor::forward_draw_over_alternatives(TileAtlasView *p_til text = "-"; } Vector2 string_size = font->get_string_size(text, font_size); - p_canvas_item->draw_string(font, p_transform.xform(position) + Vector2i(-string_size.x / 2, string_size.y / 2), text, HALIGN_CENTER, string_size.x, font_size, color, 1, Color(0, 0, 0, 1)); + p_canvas_item->draw_string(font, p_transform.xform(position) + Vector2i(-string_size.x / 2, string_size.y / 2), text, HORIZONTAL_ALIGNMENT_CENTER, string_size.x, font_size, color, 1, Color(0, 0, 0, 1)); } } } diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index fd2648a469..b4d6f3659d 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -2096,8 +2096,8 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() { missing_source_label->set_text(TTR("This TileMap's TileSet has no source configured. Edit the TileSet resource to add one.")); missing_source_label->set_h_size_flags(Control::SIZE_EXPAND_FILL); missing_source_label->set_v_size_flags(Control::SIZE_EXPAND_FILL); - missing_source_label->set_align(Label::ALIGN_CENTER); - missing_source_label->set_valign(Label::VALIGN_CENTER); + missing_source_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + missing_source_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); missing_source_label->hide(); tiles_bottom_panel->add_child(missing_source_label); @@ -2155,8 +2155,8 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() { invalid_source_label->set_text(TTR("Invalid source selected.")); invalid_source_label->set_h_size_flags(Control::SIZE_EXPAND_FILL); invalid_source_label->set_v_size_flags(Control::SIZE_EXPAND_FILL); - invalid_source_label->set_align(Label::ALIGN_CENTER); - invalid_source_label->set_valign(Label::VALIGN_CENTER); + invalid_source_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + invalid_source_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); invalid_source_label->hide(); atlas_sources_split_container->add_child(invalid_source_label); @@ -3984,8 +3984,8 @@ TileMapEditor::TileMapEditor() { missing_tileset_label->set_text(TTR("The edited TileMap node has no TileSet resource.")); missing_tileset_label->set_h_size_flags(SIZE_EXPAND_FILL); missing_tileset_label->set_v_size_flags(SIZE_EXPAND_FILL); - missing_tileset_label->set_align(Label::ALIGN_CENTER); - missing_tileset_label->set_valign(Label::VALIGN_CENTER); + missing_tileset_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + missing_tileset_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); missing_tileset_label->hide(); add_child(missing_tileset_label); diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 436fea77d7..f194e81438 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -2346,7 +2346,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { middle_vbox_container->add_child(tile_inspector); tile_inspector_no_tile_selected_label = memnew(Label); - tile_inspector_no_tile_selected_label->set_align(Label::ALIGN_CENTER); + tile_inspector_no_tile_selected_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); tile_inspector_no_tile_selected_label->set_text(TTR("No tile selected.")); middle_vbox_container->add_child(tile_inspector_no_tile_selected_label); @@ -2527,8 +2527,8 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { tile_atlas_view_missing_source_label = memnew(Label); tile_atlas_view_missing_source_label->set_text(TTR("Add or select an atlas texture to the left panel.")); - tile_atlas_view_missing_source_label->set_align(Label::ALIGN_CENTER); - tile_atlas_view_missing_source_label->set_valign(Label::VALIGN_CENTER); + tile_atlas_view_missing_source_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + tile_atlas_view_missing_source_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); tile_atlas_view_missing_source_label->set_h_size_flags(SIZE_EXPAND_FILL); tile_atlas_view_missing_source_label->set_v_size_flags(SIZE_EXPAND_FILL); tile_atlas_view_missing_source_label->hide(); diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp index 915ce50836..b7495dbea9 100644 --- a/editor/plugins/tiles/tile_set_editor.cpp +++ b/editor/plugins/tiles/tile_set_editor.cpp @@ -682,7 +682,7 @@ TileSetEditor::TileSetEditor() { split_container_left_side->add_child(sources_list); HBoxContainer *sources_bottom_actions = memnew(HBoxContainer); - sources_bottom_actions->set_alignment(HBoxContainer::ALIGN_END); + sources_bottom_actions->set_alignment(BoxContainer::ALIGNMENT_END); split_container_left_side->add_child(sources_bottom_actions); sources_delete_button = memnew(Button); @@ -722,8 +722,8 @@ TileSetEditor::TileSetEditor() { no_source_selected_label->set_text(TTR("No TileSet source selected. Select or create a TileSet source.")); no_source_selected_label->set_h_size_flags(SIZE_EXPAND_FILL); no_source_selected_label->set_v_size_flags(SIZE_EXPAND_FILL); - no_source_selected_label->set_align(Label::ALIGN_CENTER); - no_source_selected_label->set_valign(Label::VALIGN_CENTER); + no_source_selected_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + no_source_selected_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); split_container_right_side->add_child(no_source_selected_label); // Atlases editor. |