diff options
Diffstat (limited to 'editor')
59 files changed, 186 insertions, 186 deletions
diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index dc0c62fbc9..9df76b8657 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -612,7 +612,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() { add_child(main_vbox); tab_container = memnew(TabContainer); - tab_container->set_tab_align(TabContainer::TabAlign::ALIGN_LEFT); + tab_container->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); tab_container->set_use_hidden_tabs_for_min_size(true); tab_container->set_v_size_flags(Control::SIZE_EXPAND_FILL); tab_container->connect("tab_selected", callable_mp(this, &InputEventConfigurationDialog::_tab_selected)); @@ -622,7 +622,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() { VBoxContainer *vb = memnew(VBoxContainer); vb->set_name(TTR("Listen for Input")); event_as_text = memnew(Label); - event_as_text->set_align(Label::ALIGN_CENTER); + event_as_text->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); vb->add_child(event_as_text); // Mouse button detection rect (Mouse button event outside this ColorRect will be ignored) mouse_detection_rect = memnew(ColorRect); diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index a970ce3f1d..9682fb07d2 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -381,7 +381,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { draw_line(Point2(limit, i), Point2(right_limit, i), lc, Math::round(EDSCALE)); Color c = color; c.a *= 0.5; - draw_string(font, Point2(limit + 8, i - 2), TS->format_number(rtos(Math::snapped((iv + 1) * scale, step))), HALIGN_LEFT, -1, font_size, c); + draw_string(font, Point2(limit + 8, i - 2), TS->format_number(rtos(Math::snapped((iv + 1) * scale, step))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, c); } first = false; @@ -452,8 +452,8 @@ void AnimationBezierTrackEdit::_notification(int p_what) { ep.point_rect.size = bezier_icon->get_size(); if (selection.has(i)) { draw_texture(selected_icon, ep.point_rect.position); - draw_string(font, ep.point_rect.position + Vector2(8, -font->get_height(font_size) - 8), TTR("Time:") + " " + TS->format_number(rtos(Math::snapped(offset, 0.001))), HALIGN_LEFT, -1, font_size, accent); - draw_string(font, ep.point_rect.position + Vector2(8, -8), TTR("Value:") + " " + TS->format_number(rtos(Math::snapped(value, 0.001))), HALIGN_LEFT, -1, font_size, accent); + draw_string(font, ep.point_rect.position + Vector2(8, -font->get_height(font_size) - 8), TTR("Time:") + " " + TS->format_number(rtos(Math::snapped(offset, 0.001))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, accent); + draw_string(font, ep.point_rect.position + Vector2(8, -8), TTR("Value:") + " " + TS->format_number(rtos(Math::snapped(value, 0.001))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, accent); } else { draw_texture(bezier_icon, ep.point_rect.position); } diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index a306fc20de..c212523c98 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1622,7 +1622,7 @@ void AnimationTimelineEdit::_notification(int p_what) { if (frame != prev_frame && i >= prev_frame_ofs) { draw_line(Point2(get_name_limit() + i, 0), Point2(get_name_limit() + i, h), linecolor, Math::round(EDSCALE)); - draw_string(font, Point2(get_name_limit() + i + 3 * EDSCALE, (h - font->get_height(font_size)) / 2 + font->get_ascent(font_size)).floor(), itos(frame), HALIGN_LEFT, zoomw - i, font_size, sub ? color_time_dec : color_time_sec); + draw_string(font, Point2(get_name_limit() + i + 3 * EDSCALE, (h - font->get_height(font_size)) / 2 + font->get_ascent(font_size)).floor(), itos(frame), HORIZONTAL_ALIGNMENT_LEFT, zoomw - i, font_size, sub ? color_time_dec : color_time_sec); prev_frame_ofs = i + font->get_string_size(itos(frame), font_size).x + 5 * EDSCALE; } } @@ -1640,7 +1640,7 @@ void AnimationTimelineEdit::_notification(int p_what) { if ((sc / step) != (prev_sc / step) || (prev_sc < 0 && sc >= 0)) { int scd = sc < 0 ? prev_sc : sc; draw_line(Point2(get_name_limit() + i, 0), Point2(get_name_limit() + i, h), linecolor, Math::round(EDSCALE)); - draw_string(font, Point2(get_name_limit() + i + 3, (h - font->get_height(font_size)) / 2 + font->get_ascent(font_size)).floor(), String::num((scd - (scd % step)) / double(SC_ADJ), decimals), HALIGN_LEFT, zoomw - i, font_size, sub ? color_time_dec : color_time_sec); + draw_string(font, Point2(get_name_limit() + i + 3, (h - font->get_height(font_size)) / 2 + font->get_ascent(font_size)).floor(), String::num((scd - (scd % step)) / double(SC_ADJ), decimals), HORIZONTAL_ALIGNMENT_LEFT, zoomw - i, font_size, sub ? color_time_dec : color_time_sec); } } } @@ -2029,7 +2029,7 @@ void AnimationTrackEdit::_notification(int p_what) { Vector2 string_pos = Point2(ofs, (get_size().height - font->get_height(font_size)) / 2 + font->get_ascent(font_size)); string_pos = string_pos.floor(); - draw_string(font, string_pos, text, HALIGN_LEFT, limit - ofs - hsep, font_size, text_color); + draw_string(font, string_pos, text, HORIZONTAL_ALIGNMENT_LEFT, limit - ofs - hsep, font_size, text_color); draw_line(Point2(limit, 0), Point2(limit, get_size().height), linecolor, Math::round(EDSCALE)); } @@ -2340,7 +2340,7 @@ void AnimationTrackEdit::draw_key(int p_index, float p_pixels_sec, int p_x, bool int limit = MAX(0, p_clip_right - p_x - icon_to_draw->get_width()); if (limit > 0) { - draw_string(font, Vector2(p_x + icon_to_draw->get_width(), int(get_size().height - font->get_height(font_size)) / 2 + font->get_ascent(font_size)), text, HALIGN_LEFT, limit, font_size, color); + draw_string(font, Vector2(p_x + icon_to_draw->get_width(), int(get_size().height - font->get_height(font_size)) / 2 + font->get_ascent(font_size)), text, HORIZONTAL_ALIGNMENT_LEFT, limit, font_size, color); } } @@ -3234,7 +3234,7 @@ void AnimationTrackEditGroup::_notification(int p_what) { int ofs = 0; draw_texture(icon, Point2(ofs, int(get_size().height - icon->get_height()) / 2)); ofs += separation + icon->get_width(); - draw_string(font, Point2(ofs, int(get_size().height - font->get_height(font_size)) / 2 + font->get_ascent(font_size)), node_name, HALIGN_LEFT, timeline->get_name_limit() - ofs, font_size, color); + draw_string(font, Point2(ofs, int(get_size().height - font->get_height(font_size)) / 2 + font->get_ascent(font_size)), node_name, HORIZONTAL_ALIGNMENT_LEFT, timeline->get_name_limit() - ofs, font_size, color); int px = (-timeline->get_value() + timeline->get_play_position()) * timeline->get_zoom_scale() + timeline->get_name_limit(); @@ -6072,8 +6072,8 @@ AnimationTrackEditor::AnimationTrackEditor() { info_message = memnew(Label); info_message->set_text(TTR("Select an AnimationPlayer node to create and edit animations.")); - info_message->set_valign(Label::VALIGN_CENTER); - info_message->set_align(Label::ALIGN_CENTER); + info_message->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); + info_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); info_message->set_autowrap_mode(Label::AUTOWRAP_WORD_SMART); info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); info_message->set_anchors_and_offsets_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp index dd3e08b299..3c117f28a8 100644 --- a/editor/animation_track_editor_plugins.cpp +++ b/editor/animation_track_editor_plugins.cpp @@ -699,7 +699,7 @@ void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_ int limit = to_x - from_x - 4; if (limit > 0) { - draw_string(font, Point2(from_x + 2, int(get_size().height - font->get_height(font_size)) / 2 + font->get_ascent(font_size)), anim, HALIGN_LEFT, -1, font_size, color); + draw_string(font, Point2(from_x + 2, int(get_size().height - font->get_height(font_size)) / 2 + font->get_ascent(font_size)), anim, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color); } if (p_selected) { @@ -1272,7 +1272,7 @@ void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec, int limit = to_x - from_x - 4; if (limit > 0) { - draw_string(font, Point2(from_x + 2, int(get_size().height - font->get_height(font_size)) / 2 + font->get_ascent(font_size)), anim, HALIGN_LEFT, -1, font_size, color); + draw_string(font, Point2(from_x + 2, int(get_size().height - font->get_height(font_size)) / 2 + font->get_ascent(font_size)), anim, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color); } if (p_selected) { diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 0f6fdcdae5..e197c13c14 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -624,7 +624,7 @@ FindReplaceBar::FindReplaceBar() { vbc_lineedit = memnew(VBoxContainer); add_child(vbc_lineedit); - vbc_lineedit->set_alignment(ALIGN_CENTER); + vbc_lineedit->set_alignment(ALIGNMENT_CENTER); vbc_lineedit->set_h_size_flags(SIZE_EXPAND_FILL); VBoxContainer *vbc_button = memnew(VBoxContainer); add_child(vbc_button); @@ -633,10 +633,10 @@ FindReplaceBar::FindReplaceBar() { HBoxContainer *hbc_button_search = memnew(HBoxContainer); vbc_button->add_child(hbc_button_search); - hbc_button_search->set_alignment(ALIGN_END); + hbc_button_search->set_alignment(ALIGNMENT_END); hbc_button_replace = memnew(HBoxContainer); vbc_button->add_child(hbc_button_replace); - hbc_button_replace->set_alignment(ALIGN_END); + hbc_button_replace->set_alignment(ALIGNMENT_END); HBoxContainer *hbc_option_search = memnew(HBoxContainer); vbc_option->add_child(hbc_option_search); diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 85cf1558fe..8ea028a7de 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -59,7 +59,7 @@ EditorDebuggerNode::EditorDebuggerNode() { add_theme_constant_override("margin_right", -EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("BottomPanelDebuggerOverride"), SNAME("EditorStyles"))->get_margin(SIDE_RIGHT)); tabs = memnew(TabContainer); - tabs->set_tab_align(TabContainer::ALIGN_LEFT); + tabs->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); tabs->set_tabs_visible(false); tabs->connect("tab_changed", callable_mp(this, &EditorDebuggerNode::_debugger_changed)); add_child(tabs); diff --git a/editor/debugger/editor_network_profiler.cpp b/editor/debugger/editor_network_profiler.cpp index d4385630be..8b1f0085d5 100644 --- a/editor/debugger/editor_network_profiler.cpp +++ b/editor/debugger/editor_network_profiler.cpp @@ -60,7 +60,7 @@ void EditorNetworkProfiler::_update_frame() { TreeItem *node = counters_display->create_item(root); for (int j = 0; j < counters_display->get_columns(); ++j) { - node->set_text_align(j, j > 0 ? TreeItem::ALIGN_RIGHT : TreeItem::ALIGN_LEFT); + node->set_text_alignment(j, j > 0 ? HORIZONTAL_ALIGNMENT_RIGHT : HORIZONTAL_ALIGNMENT_LEFT); } node->set_text(0, E.value.node_path); @@ -149,7 +149,7 @@ EditorNetworkProfiler::EditorNetworkProfiler() { incoming_bandwidth_text = memnew(LineEdit); incoming_bandwidth_text->set_editable(false); incoming_bandwidth_text->set_custom_minimum_size(Size2(120, 0) * EDSCALE); - incoming_bandwidth_text->set_align(LineEdit::Align::ALIGN_RIGHT); + incoming_bandwidth_text->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); hb->add_child(incoming_bandwidth_text); Control *down_up_spacer = memnew(Control); @@ -163,7 +163,7 @@ EditorNetworkProfiler::EditorNetworkProfiler() { outgoing_bandwidth_text = memnew(LineEdit); outgoing_bandwidth_text->set_editable(false); outgoing_bandwidth_text->set_custom_minimum_size(Size2(120, 0) * EDSCALE); - outgoing_bandwidth_text->set_align(LineEdit::Align::ALIGN_RIGHT); + outgoing_bandwidth_text->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); hb->add_child(outgoing_bandwidth_text); // Set initial texts in the incoming/outgoing bandwidth labels diff --git a/editor/debugger/editor_performance_profiler.cpp b/editor/debugger/editor_performance_profiler.cpp index 952f46e9a5..6106f1755d 100644 --- a/editor/debugger/editor_performance_profiler.cpp +++ b/editor/debugger/editor_performance_profiler.cpp @@ -132,14 +132,14 @@ void EditorPerformanceProfiler::_monitor_draw() { rect.size -= graph_style_box->get_minimum_size(); Color draw_color = get_theme_color(SNAME("accent_color"), SNAME("Editor")); draw_color.set_hsv(Math::fmod(hue_shift * float(current.frame_index), 0.9f), draw_color.get_s() * 0.9f, draw_color.get_v() * value_multiplier, 0.6f); - monitor_draw->draw_string(graph_font, rect.position + Point2(0, graph_font->get_ascent(font_size)), current.item->get_text(0), HALIGN_LEFT, rect.size.x, font_size, draw_color); + monitor_draw->draw_string(graph_font, rect.position + Point2(0, graph_font->get_ascent(font_size)), current.item->get_text(0), HORIZONTAL_ALIGNMENT_LEFT, rect.size.x, font_size, draw_color); draw_color.a = 0.9f; float value_position = rect.size.width - graph_font->get_string_size(current.item->get_text(1), font_size).width; if (value_position < 0) { value_position = 0; } - monitor_draw->draw_string(graph_font, rect.position + Point2(value_position, graph_font->get_ascent(font_size)), current.item->get_text(1), HALIGN_LEFT, rect.size.x, font_size, draw_color); + monitor_draw->draw_string(graph_font, rect.position + Point2(value_position, graph_font->get_ascent(font_size)), current.item->get_text(1), HORIZONTAL_ALIGNMENT_LEFT, rect.size.x, font_size, draw_color); rect.position.y += graph_font->get_height(font_size); rect.size.height -= graph_font->get_height(font_size); @@ -152,12 +152,12 @@ void EditorPerformanceProfiler::_monitor_draw() { Color horizontal_line_color; horizontal_line_color.set_hsv(draw_color.get_h(), draw_color.get_s() * 0.5f, draw_color.get_v() * 0.5f, 0.3f); monitor_draw->draw_line(rect.position, rect.position + Vector2(rect.size.width, 0), horizontal_line_color, Math::round(EDSCALE)); - monitor_draw->draw_string(graph_font, rect.position + Vector2(0, graph_font->get_ascent(font_size)), _create_label(current.max, current.type), HALIGN_LEFT, rect.size.width, font_size, horizontal_line_color); + monitor_draw->draw_string(graph_font, rect.position + Vector2(0, graph_font->get_ascent(font_size)), _create_label(current.max, current.type), HORIZONTAL_ALIGNMENT_LEFT, rect.size.width, font_size, horizontal_line_color); for (int j = 0; j < line_count; j++) { Vector2 y_offset = Vector2(0, rect.size.height * (1.0f - float(j) / float(line_count))); monitor_draw->draw_line(rect.position + y_offset, rect.position + Vector2(rect.size.width, 0) + y_offset, horizontal_line_color, Math::round(EDSCALE)); - monitor_draw->draw_string(graph_font, rect.position - Vector2(0, graph_font->get_descent(font_size)) + y_offset, _create_label(current.max * float(j) / float(line_count), current.type), HALIGN_LEFT, rect.size.width, font_size, horizontal_line_color); + monitor_draw->draw_string(graph_font, rect.position - Vector2(0, graph_font->get_descent(font_size)) + y_offset, _create_label(current.max * float(j) / float(line_count), current.type), HORIZONTAL_ALIGNMENT_LEFT, rect.size.width, font_size, horizontal_line_color); } } @@ -191,7 +191,7 @@ void EditorPerformanceProfiler::_monitor_draw() { if (text_top_left_position.y < 0) { text_top_left_position.y = h2 + MARKER_MARGIN; } - monitor_draw->draw_string(graph_font, rect.position + text_top_left_position + Point2(0, graph_font->get_ascent(font_size)), label, HALIGN_LEFT, rect.size.x, font_size, line_color); + monitor_draw->draw_string(graph_font, rect.position + text_top_left_position + Point2(0, graph_font->get_ascent(font_size)), label, HORIZONTAL_ALIGNMENT_LEFT, rect.size.x, font_size, line_color); } prev = h2; e = e->next(); @@ -378,8 +378,8 @@ EditorPerformanceProfiler::EditorPerformanceProfiler() { info_message = memnew(Label); info_message->set_text(TTR("Pick one or more items from the list to display the graph.")); - info_message->set_valign(Label::VALIGN_CENTER); - info_message->set_align(Label::ALIGN_CENTER); + info_message->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); + info_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); info_message->set_autowrap_mode(Label::AUTOWRAP_WORD_SMART); info_message->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); info_message->set_anchors_and_offsets_preset(PRESET_WIDE, PRESET_MODE_KEEP_SIZE, 8 * EDSCALE); diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp index d08ae1de8a..2bdacb51b8 100644 --- a/editor/debugger/editor_profiler.cpp +++ b/editor/debugger/editor_profiler.cpp @@ -355,7 +355,7 @@ void EditorProfiler::_update_frame() { item->set_metadata(0, it.signature); item->set_metadata(1, it.script); item->set_metadata(2, it.line); - item->set_text_align(2, TreeItem::ALIGN_RIGHT); + item->set_text_alignment(2, HORIZONTAL_ALIGNMENT_RIGHT); item->set_tooltip(0, it.name + "\n" + it.script + ":" + itos(it.line)); float time = dtime == DISPLAY_SELF_TIME ? it.self : it.total; diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 4739458f8e..a4e4ed4020 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -462,7 +462,7 @@ void EditorVisualProfiler::_graph_tex_draw() { graph->draw_line(Vector2(0, frame_y), Vector2(half_width, frame_y), Color(1, 1, 1, 0.3)); String limit_str = String::num(graph_limit, 2); - graph->draw_string(font, Vector2(half_width - font->get_string_size(limit_str, font_size).x - 2, frame_y - 2), limit_str, HALIGN_LEFT, -1, font_size, Color(1, 1, 1, 0.6)); + graph->draw_string(font, Vector2(half_width - font->get_string_size(limit_str, font_size).x - 2, frame_y - 2), limit_str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1, 1, 1, 0.6)); } if (graph_height_gpu > 0) { @@ -473,11 +473,11 @@ void EditorVisualProfiler::_graph_tex_draw() { graph->draw_line(Vector2(half_width, frame_y), Vector2(graph->get_size().x, frame_y), Color(1, 1, 1, 0.3)); String limit_str = String::num(graph_limit, 2); - graph->draw_string(font, Vector2(half_width * 2 - font->get_string_size(limit_str, font_size).x - 2, frame_y - 2), limit_str, HALIGN_LEFT, -1, font_size, Color(1, 1, 1, 0.6)); + graph->draw_string(font, Vector2(half_width * 2 - font->get_string_size(limit_str, font_size).x - 2, frame_y - 2), limit_str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1, 1, 1, 0.6)); } - graph->draw_string(font, Vector2(font->get_string_size("X", font_size).x, font->get_ascent(font_size) + 2), "CPU:", HALIGN_LEFT, -1, font_size, Color(1, 1, 1, 0.8)); - graph->draw_string(font, Vector2(font->get_string_size("X", font_size).x + graph->get_size().width / 2, font->get_ascent(font_size) + 2), "GPU:", HALIGN_LEFT, -1, font_size, Color(1, 1, 1, 0.8)); + graph->draw_string(font, Vector2(font->get_string_size("X", font_size).x, font->get_ascent(font_size) + 2), "CPU:", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1, 1, 1, 0.8)); + graph->draw_string(font, Vector2(font->get_string_size("X", font_size).x + graph->get_size().width / 2, font->get_ascent(font_size) + 2), "GPU:", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1, 1, 1, 0.8)); /* if (hover_metric != -1 && frame_metrics[hover_metric].valid) { diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index bcff9cc56a..71e501056c 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -499,7 +499,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da error->set_icon(0, get_theme_icon(oe.warning ? "Warning" : "Error", "EditorIcons")); error->set_text(0, time); - error->set_text_align(0, TreeItem::ALIGN_LEFT); + error->set_text_alignment(0, HORIZONTAL_ALIGNMENT_LEFT); const Color color = get_theme_color(oe.warning ? SNAME("warning_color") : SNAME("error_color"), SNAME("Editor")); error->set_custom_color(0, color); @@ -524,7 +524,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da TreeItem *cpp_cond = error_tree->create_item(error); cpp_cond->set_text(0, "<" + TTR("C++ Error") + ">"); cpp_cond->set_text(1, oe.error); - cpp_cond->set_text_align(0, TreeItem::ALIGN_LEFT); + cpp_cond->set_text_alignment(0, HORIZONTAL_ALIGNMENT_LEFT); tooltip += TTR("C++ Error:") + " " + oe.error + "\n"; if (source_is_project_file) { cpp_cond->set_metadata(0, source_meta); @@ -542,7 +542,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da TreeItem *cpp_source = error_tree->create_item(error); cpp_source->set_text(0, "<" + (source_is_project_file ? TTR("Source") : TTR("C++ Source")) + ">"); cpp_source->set_text(1, source_txt); - cpp_source->set_text_align(0, TreeItem::ALIGN_LEFT); + cpp_source->set_text_alignment(0, HORIZONTAL_ALIGNMENT_LEFT); tooltip += (source_is_project_file ? TTR("Source:") : TTR("C++ Source:")) + " " + source_txt + "\n"; // Set metadata to highlight error line in scripts. @@ -565,7 +565,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da if (i == 0) { stack_trace->set_text(0, "<" + TTR("Stack Trace") + ">"); - stack_trace->set_text_align(0, TreeItem::ALIGN_LEFT); + stack_trace->set_text_alignment(0, HORIZONTAL_ALIGNMENT_LEFT); error->set_metadata(0, meta); tooltip += TTR("Stack Trace:") + "\n"; } @@ -1574,7 +1574,7 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) { editor = p_editor; tabs = memnew(TabContainer); - tabs->set_tab_align(TabContainer::ALIGN_LEFT); + tabs->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); tabs->add_theme_style_override("panel", editor->get_gui_base()->get_theme_stylebox(SNAME("DebuggerPanel"), SNAME("EditorStyles"))); tabs->connect("tab_changed", callable_mp(this, &ScriptEditorDebugger::_tab_changed)); diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index 414264e697..2de92f5184 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -125,7 +125,7 @@ EditorAbout::EditorAbout() { vbc->connect("theme_changed", callable_mp(this, &EditorAbout::_theme_changed)); HBoxContainer *hbc = memnew(HBoxContainer); hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); - hbc->set_alignment(BoxContainer::ALIGN_CENTER); + hbc->set_alignment(BoxContainer::ALIGNMENT_CENTER); hbc->add_theme_constant_override("separation", 30 * EDSCALE); add_child(vbc); vbc->add_child(hbc); diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 656c219d1c..81a1f26818 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -1422,7 +1422,7 @@ void EditorAudioMeterNotches::_draw_audio_notches() { Vector2((line_length + label_space) * EDSCALE, (1.0f - n.relative_position) * (get_size().y - btm_padding - top_padding) + (font_height / 4) + top_padding), String::num(Math::abs(n.db_value)) + "dB", - HALIGN_LEFT, -1, font_size, + HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, notch_color); } } diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index 25e76c2262..86da3f89a6 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -838,7 +838,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() { error_message = memnew(Label); error_message->hide(); - error_message->set_align(Label::Align::ALIGN_RIGHT); + error_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); error_message->add_theme_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("error_color"), SNAME("Editor"))); add_child(error_message); diff --git a/editor/editor_command_palette.cpp b/editor/editor_command_palette.cpp index 52e55de84c..1b1a7a4a09 100644 --- a/editor/editor_command_palette.cpp +++ b/editor/editor_command_palette.cpp @@ -128,7 +128,7 @@ void EditorCommandPalette::_update_command_search(const String &search_text) { String shortcut_text = entries[i].shortcut_text == "None" ? "" : entries[i].shortcut_text; ti->set_text(0, entries[i].display_name); ti->set_metadata(0, entries[i].key_name); - ti->set_text_align(1, TreeItem::TextAlign::ALIGN_RIGHT); + ti->set_text_alignment(1, HORIZONTAL_ALIGNMENT_RIGHT); ti->set_text(1, shortcut_text); Color c = Color(1, 1, 1, 0.5); ti->set_custom_color(1, c); diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index 2222a5e5d3..78175ff022 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -948,7 +948,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() { Ref<StyleBoxEmpty> sb = memnew(StyleBoxEmpty); sb->set_default_margin(SIDE_TOP, 20 * EDSCALE); no_profile_selected_help->add_theme_style_override("normal", sb); - no_profile_selected_help->set_align(Label::ALIGN_CENTER); + no_profile_selected_help->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); no_profile_selected_help->set_v_size_flags(Control::SIZE_EXPAND_FILL); h_split->add_child(no_profile_selected_help); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index c95b1c753e..56718e4090 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -235,7 +235,7 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview if (p_overview) { class_desc->push_cell(); - class_desc->push_paragraph(RichTextLabel::ALIGN_RIGHT, Control::TEXT_DIRECTION_AUTO, ""); + class_desc->push_paragraph(HORIZONTAL_ALIGNMENT_RIGHT, Control::TEXT_DIRECTION_AUTO, ""); } else { _add_bulletpoint(); } @@ -685,7 +685,7 @@ void EditorHelp::_update_doc() { // Property type. class_desc->push_cell(); - class_desc->push_paragraph(RichTextLabel::ALIGN_RIGHT, Control::TEXT_DIRECTION_AUTO, ""); + class_desc->push_paragraph(HORIZONTAL_ALIGNMENT_RIGHT, Control::TEXT_DIRECTION_AUTO, ""); class_desc->push_font(doc_code_font); _add_type(cd.properties[i].type, cd.properties[i].enumeration); class_desc->pop(); @@ -1646,7 +1646,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { tag_stack.push_front(tag); } else if (tag == "center") { //align to center - p_rt->push_paragraph(RichTextLabel::ALIGN_CENTER, Control::TEXT_DIRECTION_AUTO, ""); + p_rt->push_paragraph(HORIZONTAL_ALIGNMENT_CENTER, Control::TEXT_DIRECTION_AUTO, ""); pos = brk_end + 1; tag_stack.push_front(tag); } else if (tag == "br") { diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 485a093aa1..8187f982e1 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -310,7 +310,7 @@ void EditorProperty::_notification(int p_what) { Ref<Texture2D> pinned_icon = get_theme_icon(SNAME("Pin"), SNAME("EditorIcons")); int margin_w = get_theme_constant(SNAME("hseparator"), SNAME("Tree")) * 2; int total_icon_w = margin_w + pinned_icon->get_width(); - int text_w = font->get_string_size(label, font_size, rtl ? HALIGN_RIGHT : HALIGN_LEFT, text_limit - total_icon_w).x; + int text_w = font->get_string_size(label, font_size, rtl ? HORIZONTAL_ALIGNMENT_RIGHT : HORIZONTAL_ALIGNMENT_LEFT, text_limit - total_icon_w).x; int y = (size.height - pinned_icon->get_height()) / 2; if (rtl) { draw_texture(pinned_icon, Vector2(size.width - ofs - text_w - total_icon_w, y), color); @@ -322,9 +322,9 @@ void EditorProperty::_notification(int p_what) { int v_ofs = (size.height - font->get_height(font_size)) / 2; if (rtl) { - draw_string(font, Point2(size.width - ofs - text_limit, v_ofs + font->get_ascent(font_size)), label, HALIGN_RIGHT, text_limit, font_size, color); + draw_string(font, Point2(size.width - ofs - text_limit, v_ofs + font->get_ascent(font_size)), label, HORIZONTAL_ALIGNMENT_RIGHT, text_limit, font_size, color); } else { - draw_string(font, Point2(ofs, v_ofs + font->get_ascent(font_size)), label, HALIGN_LEFT, text_limit, font_size, color); + draw_string(font, Point2(ofs, v_ofs + font->get_ascent(font_size)), label, HORIZONTAL_ALIGNMENT_LEFT, text_limit, font_size, color); } if (keying) { @@ -1077,7 +1077,7 @@ void EditorInspectorCategory::_notification(int p_what) { } Color color = get_theme_color(SNAME("font_color"), SNAME("Tree")); - draw_string(font, Point2(ofs, font->get_ascent(font_size) + (get_size().height - font->get_height(font_size)) / 2).floor(), label, HALIGN_LEFT, get_size().width, font_size, color); + draw_string(font, Point2(ofs, font->get_ascent(font_size) + (get_size().height - font->get_height(font_size)) / 2).floor(), label, HORIZONTAL_ALIGNMENT_LEFT, get_size().width, font_size, color); } } @@ -1230,7 +1230,7 @@ void EditorInspectorSection::_notification(int p_what) { const int arrow_width = arrow.is_valid() ? arrow->get_width() : 0; Color color = get_theme_color(SNAME("font_color")); float text_width = get_size().width - Math::round(arrow_width + arrow_margin * EDSCALE); - draw_string(font, Point2(rtl ? 0 : Math::round(arrow_width + arrow_margin * EDSCALE), font->get_ascent(font_size) + (header_height - font->get_height(font_size)) / 2).floor(), label, rtl ? HALIGN_RIGHT : HALIGN_LEFT, text_width, font_size, color); + draw_string(font, Point2(rtl ? 0 : Math::round(arrow_width + arrow_margin * EDSCALE), font->get_ascent(font_size) + (header_height - font->get_height(font_size)) / 2).floor(), label, rtl ? HORIZONTAL_ALIGNMENT_RIGHT : HORIZONTAL_ALIGNMENT_LEFT, text_width, font_size, color); if (arrow.is_valid()) { if (rtl) { @@ -2083,13 +2083,13 @@ EditorInspectorArray::EditorInspectorArray() { add_button = memnew(Button); add_button->set_text(TTR("Add Element")); - add_button->set_text_align(Button::ALIGN_CENTER); + add_button->set_text_alignment(HORIZONTAL_ALIGNMENT_CENTER); add_button->connect("pressed", callable_mp(this, &EditorInspectorArray::_add_button_pressed)); vbox->add_child(add_button); hbox_pagination = memnew(HBoxContainer); hbox_pagination->set_h_size_flags(SIZE_EXPAND_FILL); - hbox_pagination->set_alignment(HBoxContainer::ALIGN_CENTER); + hbox_pagination->set_alignment(BoxContainer::ALIGNMENT_CENTER); vbox->add_child(hbox_pagination); first_page_button = memnew(Button); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index f06ef39bc3..3f20734e3f 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -6150,7 +6150,7 @@ EditorNode::EditorNode() { Label *dock_label = memnew(Label); dock_label->set_text(TTR("Dock Position")); dock_label->set_h_size_flags(Control::SIZE_EXPAND_FILL); - dock_label->set_align(Label::ALIGN_CENTER); + dock_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); dock_hb->add_child(dock_label); dock_tab_move_right = memnew(Button); @@ -6190,7 +6190,7 @@ EditorNode::EditorNode() { dock_slot[i]->set_v_size_flags(Control::SIZE_EXPAND_FILL); dock_slot[i]->set_popup(dock_select_popup); dock_slot[i]->connect("pre_popup_pressed", callable_mp(this, &EditorNode::_dock_pre_popup), varray(i)); - dock_slot[i]->set_tab_align(TabContainer::ALIGN_LEFT); + dock_slot[i]->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); dock_slot[i]->set_drag_to_rearrange_enabled(true); dock_slot[i]->set_tabs_rearrange_group(1); dock_slot[i]->connect("tab_changed", callable_mp(this, &EditorNode::_dock_tab_changed)); @@ -6230,7 +6230,7 @@ EditorNode::EditorNode() { scene_tabs->add_theme_style_override("tab_unselected", gui_base->get_theme_stylebox(SNAME("SceneTabBG"), SNAME("EditorStyles"))); scene_tabs->set_select_with_rmb(true); scene_tabs->add_tab("unsaved"); - scene_tabs->set_tab_align(TabBar::ALIGN_LEFT); + scene_tabs->set_tab_alignment(TabBar::ALIGNMENT_LEFT); scene_tabs->set_tab_close_display_policy((bool(EDITOR_DEF("interface/scene_tabs/always_show_close_button", false)) ? TabBar::CLOSE_BUTTON_SHOW_ALWAYS : TabBar::CLOSE_BUTTON_SHOW_ACTIVE_ONLY)); scene_tabs->set_min_width(int(EDITOR_DEF("interface/scene_tabs/minimum_width", 50)) * EDSCALE); scene_tabs->set_drag_to_rearrange_enabled(true); diff --git a/editor/editor_path.cpp b/editor/editor_path.cpp index f3b3eedccc..45c0232072 100644 --- a/editor/editor_path.cpp +++ b/editor/editor_path.cpp @@ -211,7 +211,7 @@ EditorPath::EditorPath(EditorHistory *p_history) { current_object_label = memnew(Label); current_object_label->set_clip_text(true); - current_object_label->set_align(Label::ALIGN_LEFT); + current_object_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_LEFT); current_object_label->set_h_size_flags(SIZE_EXPAND_FILL); main_hb->add_child(current_object_label); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 24c229adfd..8e8a290ebb 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -891,7 +891,7 @@ public: Vector2 offset; offset.y = rect2.size.y * 0.75; - draw_string(font, rect2.position + offset, itos(layer_index + 1), HALIGN_CENTER, rect2.size.x, font_size, on ? text_color_on : text_color); + draw_string(font, rect2.position + offset, itos(layer_index + 1), HORIZONTAL_ALIGNMENT_CENTER, rect2.size.x, font_size, on ? text_color_on : text_color); ofs.x += bsize + 1; @@ -1383,7 +1383,7 @@ void EditorPropertyEasing::_draw_easing() { } else { decimals = 1; } - f->draw_string(ci, Point2(10, 10 + f->get_ascent(font_size)), TS->format_number(rtos(exp).pad_decimals(decimals)), HALIGN_LEFT, -1, font_size, font_color); + f->draw_string(ci, Point2(10, 10 + f->get_ascent(font_size)), TS->format_number(rtos(exp).pad_decimals(decimals)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color); } void EditorPropertyEasing::update_property() { diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index f07a5ab523..5565ec8f90 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -323,9 +323,9 @@ void EditorSpinSlider::_draw_spin_slider() { } if (rtl) { - draw_string(font, Vector2(Math::round(size.width - sb->get_offset().x - label_width), vofs), label, HALIGN_RIGHT, -1, font_size, lc * Color(1, 1, 1, 0.5)); + draw_string(font, Vector2(Math::round(size.width - sb->get_offset().x - label_width), vofs), label, HORIZONTAL_ALIGNMENT_RIGHT, -1, font_size, lc * Color(1, 1, 1, 0.5)); } else { - draw_string(font, Vector2(Math::round(sb->get_offset().x), vofs), label, HALIGN_LEFT, -1, font_size, lc * Color(1, 1, 1, 0.5)); + draw_string(font, Vector2(Math::round(sb->get_offset().x), vofs), label, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, lc * Color(1, 1, 1, 0.5)); } int suffix_start = numstr.length(); diff --git a/editor/editor_zoom_widget.cpp b/editor/editor_zoom_widget.cpp index a998ec7e5b..5a37d882c2 100644 --- a/editor/editor_zoom_widget.cpp +++ b/editor/editor_zoom_widget.cpp @@ -183,7 +183,7 @@ EditorZoomWidget::EditorZoomWidget() { zoom_reset->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_reset", TTR("Zoom Reset"), KeyModifierMask::CMD | Key::KEY_0)); zoom_reset->set_shortcut_context(this); zoom_reset->set_focus_mode(FOCUS_NONE); - zoom_reset->set_text_align(Button::TextAlign::ALIGN_CENTER); + zoom_reset->set_text_alignment(HORIZONTAL_ALIGNMENT_CENTER); // Prevent the button's size from changing when the text size changes zoom_reset->set_custom_minimum_size(Size2(75 * EDSCALE, 0)); diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index cb88e9d75e..f63fcb2938 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -827,7 +827,7 @@ ExportTemplateManager::ExportTemplateManager() { current_missing_label->set_theme_type_variation("HeaderSmall"); current_missing_label->set_h_size_flags(Control::SIZE_EXPAND_FILL); - current_missing_label->set_align(Label::ALIGN_RIGHT); + current_missing_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); current_missing_label->set_text(TTR("Export templates are missing. Download them or install from a file.")); current_hb->add_child(current_missing_label); @@ -835,7 +835,7 @@ ExportTemplateManager::ExportTemplateManager() { current_installed_label = memnew(Label); current_installed_label->set_theme_type_variation("HeaderSmall"); current_installed_label->set_h_size_flags(Control::SIZE_EXPAND_FILL); - current_installed_label->set_align(Label::ALIGN_RIGHT); + current_installed_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); current_installed_label->set_text(TTR("Export templates are installed and ready to be used.")); current_hb->add_child(current_installed_label); current_installed_label->hide(); @@ -909,7 +909,7 @@ ExportTemplateManager::ExportTemplateManager() { } HBoxContainer *install_file_hb = memnew(HBoxContainer); - install_file_hb->set_alignment(BoxContainer::ALIGN_END); + install_file_hb->set_alignment(BoxContainer::ALIGNMENT_END); install_options_vb->add_child(install_file_hb); install_file_button = memnew(Button); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 6d0b07d601..39452b7192 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -2936,7 +2936,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { Label *slabel = memnew(Label); slabel->set_text(TTR("Scanning Files,\nPlease Wait...")); - slabel->set_align(Label::ALIGN_CENTER); + slabel->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); scanning_vb->add_child(slabel); scanning_progress = memnew(ProgressBar); diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index f01c7f50f7..ce5e0e03fd 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -544,8 +544,8 @@ GroupDialog::GroupDialog() { group_empty->set_theme_type_variation("HeaderSmall"); group_empty->set_text(TTR("Empty groups will be automatically removed.")); - group_empty->set_valign(Label::VALIGN_CENTER); - group_empty->set_align(Label::ALIGN_CENTER); + group_empty->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); + group_empty->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); group_empty->set_autowrap_mode(Label::AUTOWRAP_WORD_SMART); group_empty->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); nodes_to_remove->add_child(group_empty); diff --git a/editor/import/dynamicfont_import_settings.cpp b/editor/import/dynamicfont_import_settings.cpp index a44ee8a3f6..83c0f56d87 100644 --- a/editor/import/dynamicfont_import_settings.cpp +++ b/editor/import/dynamicfont_import_settings.cpp @@ -1083,7 +1083,7 @@ void DynamicFontImportSettings::_edit_range(int32_t p_start, int32_t p_end) { item = glyph_table->create_item(root); ERR_FAIL_NULL(item); item->set_text(0, _pad_zeros(String::num_int64(c, 16))); - item->set_text_align(0, TreeItem::ALIGN_LEFT); + item->set_text_alignment(0, HORIZONTAL_ALIGNMENT_LEFT); item->set_selectable(0, false); item->set_custom_bg_color(0, glyph_table->get_theme_color("dark_color_3", "Editor")); } @@ -1101,7 +1101,7 @@ void DynamicFontImportSettings::_edit_range(int32_t p_start, int32_t p_end) { item->set_custom_bg_color(col + 1, glyph_table->get_theme_color("dark_color_2", "Editor")); } item->set_metadata(col + 1, c); - item->set_text_align(col + 1, TreeItem::ALIGN_CENTER); + item->set_text_alignment(col + 1, HORIZONTAL_ALIGNMENT_CENTER); item->set_selectable(col + 1, true); item->set_custom_font(col + 1, font_main); item->set_custom_font_size(col + 1, get_theme_font_size("font_size") * 2); @@ -1632,7 +1632,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { root_vb->add_child(main_pages); label_warn = memnew(Label); - label_warn->set_align(Label::ALIGN_CENTER); + label_warn->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); label_warn->set_text(""); root_vb->add_child(label_warn); label_warn->add_theme_color_override("font_color", warn_color); @@ -1656,8 +1656,8 @@ DynamicFontImportSettings::DynamicFontImportSettings() { font_preview_label = memnew(Label); font_preview_label->add_theme_font_size_override("font_size", 200 * EDSCALE); - font_preview_label->set_align(Label::ALIGN_CENTER); - font_preview_label->set_valign(Label::VALIGN_CENTER); + font_preview_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + font_preview_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); font_preview_label->set_autowrap_mode(Label::AUTOWRAP_ARBITRARY); font_preview_label->set_clip_text(true); font_preview_label->set_v_size_flags(Control::SIZE_EXPAND_FILL); @@ -1694,7 +1694,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { label_vars = memnew(Label); page2_hb_vars->add_child(label_vars); - label_vars->set_align(Label::ALIGN_CENTER); + label_vars->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); label_vars->set_h_size_flags(Control::SIZE_EXPAND_FILL); label_vars->set_text(TTR("Configuration:")); @@ -1845,7 +1845,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { page5_vb->add_child(hb_lang); label_langs = memnew(Label); - label_langs->set_align(Label::ALIGN_CENTER); + label_langs->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); label_langs->set_h_size_flags(Control::SIZE_EXPAND_FILL); label_langs->set_text(TTR("Language support overrides")); hb_lang->add_child(label_langs); @@ -1873,7 +1873,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { page5_vb->add_child(hb_script); label_script = memnew(Label); - label_script->set_align(Label::ALIGN_CENTER); + label_script->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); label_script->set_h_size_flags(Control::SIZE_EXPAND_FILL); label_script->set_text(TTR("Script support overrides")); hb_script->add_child(label_script); diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp index 7458f617c3..9d48a43d4d 100644 --- a/editor/localization_editor.cpp +++ b/editor/localization_editor.cpp @@ -641,7 +641,7 @@ LocalizationEditor::LocalizationEditor() { translation_locales_list_created = false; TabContainer *translations = memnew(TabContainer); - translations->set_tab_align(TabContainer::ALIGN_LEFT); + translations->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); translations->set_v_size_flags(Control::SIZE_EXPAND_FILL); add_child(translations); diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp index 532413897b..c3dc7eae28 100644 --- a/editor/node_dock.cpp +++ b/editor/node_dock.cpp @@ -128,8 +128,8 @@ NodeDock::NodeDock() { select_a_node->set_text(TTR("Select a single node to edit its signals and groups.")); select_a_node->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); select_a_node->set_v_size_flags(SIZE_EXPAND_FILL); - select_a_node->set_valign(Label::VALIGN_CENTER); - select_a_node->set_align(Label::ALIGN_CENTER); + select_a_node->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); + select_a_node->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); select_a_node->set_autowrap_mode(Label::AUTOWRAP_WORD_SMART); add_child(select_a_node); } diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index 58f92a98a6..72d94e61ca 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -554,7 +554,7 @@ void AbstractPolygon2DEditor::forward_canvas_draw_over_viewport(Control *p_overl int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label")); String num = String::num(vertex.vertex); Size2 num_size = font->get_string_size(num, font_size); - p_overlay->draw_string(font, point - num_size * 0.5, num, HALIGN_LEFT, -1, font_size, Color(1.0, 1.0, 1.0, 0.5)); + p_overlay->draw_string(font, point - num_size * 0.5, num, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1.0, 1.0, 1.0, 0.5)); } } } diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp index e8d91ed1ae..b9ad18ef51 100644 --- a/editor/plugins/animation_blend_space_1d_editor.cpp +++ b/editor/plugins/animation_blend_space_1d_editor.cpp @@ -223,7 +223,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_draw() { float x = point; blend_space_draw->draw_line(Point2(x, s.height - 1), Point2(x, s.height - 5 * EDSCALE), linecolor); - blend_space_draw->draw_string(font, Point2(x + 2 * EDSCALE, s.height - 2 * EDSCALE - font->get_height(font_size) + font->get_ascent(font_size)), "0", HALIGN_LEFT, -1, font_size, linecolor); + blend_space_draw->draw_string(font, Point2(x + 2 * EDSCALE, s.height - 2 * EDSCALE - font->get_height(font_size) + font->get_ascent(font_size)), "0", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, linecolor); blend_space_draw->draw_line(Point2(x, s.height - 5 * EDSCALE), Point2(x, 0), linecolor_soft); } diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp index cb9fe10212..362b0b6cf7 100644 --- a/editor/plugins/animation_blend_space_2d_editor.cpp +++ b/editor/plugins/animation_blend_space_2d_editor.cpp @@ -412,14 +412,14 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_draw() { if (blend_space->get_min_space().y < 0) { int y = (blend_space->get_max_space().y / (blend_space->get_max_space().y - blend_space->get_min_space().y)) * s.height; blend_space_draw->draw_line(Point2(0, y), Point2(5 * EDSCALE, y), linecolor); - blend_space_draw->draw_string(font, Point2(2 * EDSCALE, y - font->get_height(font_size) + font->get_ascent(font_size)), "0", HALIGN_LEFT, -1, font_size, linecolor); + blend_space_draw->draw_string(font, Point2(2 * EDSCALE, y - font->get_height(font_size) + font->get_ascent(font_size)), "0", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, linecolor); blend_space_draw->draw_line(Point2(5 * EDSCALE, y), Point2(s.width, y), linecolor_soft); } if (blend_space->get_min_space().x < 0) { int x = (-blend_space->get_min_space().x / (blend_space->get_max_space().x - blend_space->get_min_space().x)) * s.width; blend_space_draw->draw_line(Point2(x, s.height - 1), Point2(x, s.height - 5 * EDSCALE), linecolor); - blend_space_draw->draw_string(font, Point2(x + 2 * EDSCALE, s.height - 2 * EDSCALE - font->get_height(font_size) + font->get_ascent(font_size)), "0", HALIGN_LEFT, -1, font_size, linecolor); + blend_space_draw->draw_string(font, Point2(x + 2 * EDSCALE, s.height - 2 * EDSCALE - font->get_height(font_size) + font->get_ascent(font_size)), "0", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, linecolor); blend_space_draw->draw_line(Point2(x, s.height - 5 * EDSCALE), Point2(x, 0), linecolor_soft); } diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index d3dd33e67e..391565057c 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -761,12 +761,12 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() { bool onstart = state_machine->get_start_node() == name; if (onstart) { - state_machine_draw->draw_string(font, offset + Vector2(0, -font->get_height(font_size) - 3 * EDSCALE + font->get_ascent(font_size)), TTR("Start"), HALIGN_LEFT, -1, font_size, font_color); + state_machine_draw->draw_string(font, offset + Vector2(0, -font->get_height(font_size) - 3 * EDSCALE + font->get_ascent(font_size)), TTR("Start"), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color); } if (state_machine->get_end_node() == name) { int endofs = nr.node.size.x - font->get_string_size(TTR("End"), font_size).x; - state_machine_draw->draw_string(font, offset + Vector2(endofs, -font->get_height(font_size) - 3 * EDSCALE + font->get_ascent(font_size)), TTR("End"), HALIGN_LEFT, -1, font_size, font_color); + state_machine_draw->draw_string(font, offset + Vector2(endofs, -font->get_height(font_size) - 3 * EDSCALE + font->get_ascent(font_size)), TTR("End"), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color); } offset.x += sb->get_offset().x; @@ -786,7 +786,7 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() { nr.name.position = offset + Vector2(0, (h - font->get_height(font_size)) / 2).floor(); nr.name.size = Vector2(strsize, font->get_height(font_size)); - state_machine_draw->draw_string(font, nr.name.position + Vector2(0, font->get_ascent(font_size)), name, HALIGN_LEFT, -1, font_size, font_color); + state_machine_draw->draw_string(font, nr.name.position + Vector2(0, font->get_ascent(font_size)), name, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color); offset.x += strsize + sep; if (needs_editor) { diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 5cfd7525e5..4f3b5db1da 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1452,11 +1452,11 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { library_vb_border->add_child(library_vb); library_loading = memnew(Label(TTR("Loading..."))); - library_loading->set_align(Label::ALIGN_CENTER); + library_loading->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); library_vb->add_child(library_loading); library_error = memnew(Label); - library_error->set_align(Label::ALIGN_CENTER); + library_error->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); library_error->hide(); library_vb->add_child(library_error); diff --git a/editor/plugins/audio_stream_editor_plugin.cpp b/editor/plugins/audio_stream_editor_plugin.cpp index c76713f534..c621ade5c8 100644 --- a/editor/plugins/audio_stream_editor_plugin.cpp +++ b/editor/plugins/audio_stream_editor_plugin.cpp @@ -241,7 +241,7 @@ AudioStreamEditor::AudioStreamEditor() { _stop_button->connect("pressed", callable_mp(this, &AudioStreamEditor::_stop)); _current_label = memnew(Label); - _current_label->set_align(Label::ALIGN_RIGHT); + _current_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); _current_label->set_h_size_flags(SIZE_EXPAND_FILL); _current_label->add_theme_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_theme_font(SNAME("status_source"), SNAME("EditorFonts"))); _current_label->add_theme_font_size_override("font_size", EditorNode::get_singleton()->get_gui_base()->get_theme_font_size(SNAME("status_source_size"), SNAME("EditorFonts"))); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 737b69b8b7..d92564581d 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2651,7 +2651,7 @@ void CanvasItemEditor::_draw_text_at_position(Point2 p_position, String p_string p_position += Vector2(-text_size.x / 2, text_size.y + 5); break; } - viewport->draw_string(font, p_position, p_string, HALIGN_LEFT, -1, font_size, color); + viewport->draw_string(font, p_position, p_string, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color); } void CanvasItemEditor::_draw_margin_at_position(int p_value, Point2 p_position, Side p_side) { @@ -2711,7 +2711,7 @@ void CanvasItemEditor::_draw_guides() { Ref<Font> font = get_theme_font(SNAME("bold"), SNAME("EditorFonts")); int font_size = get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts")); Size2 text_size = font->get_string_size(str, font_size); - viewport->draw_string(font, Point2(dragged_guide_pos.x + 10, RULER_WIDTH + text_size.y / 2 + 10), str, HALIGN_LEFT, -1, font_size, text_color, outline_size, outline_color); + viewport->draw_string(font, Point2(dragged_guide_pos.x + 10, RULER_WIDTH + text_size.y / 2 + 10), str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color, outline_size, outline_color); viewport->draw_line(Point2(dragged_guide_pos.x, 0), Point2(dragged_guide_pos.x, viewport->get_size().y), guide_color, Math::round(EDSCALE)); } if (drag_type == DRAG_DOUBLE_GUIDE || drag_type == DRAG_H_GUIDE) { @@ -2719,7 +2719,7 @@ void CanvasItemEditor::_draw_guides() { Ref<Font> font = get_theme_font(SNAME("bold"), SNAME("EditorFonts")); int font_size = get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts")); Size2 text_size = font->get_string_size(str, font_size); - viewport->draw_string(font, Point2(RULER_WIDTH + 10, dragged_guide_pos.y + text_size.y / 2 + 10), str, HALIGN_LEFT, -1, font_size, text_color, outline_size, outline_color); + viewport->draw_string(font, Point2(RULER_WIDTH + 10, dragged_guide_pos.y + text_size.y / 2 + 10), str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color, outline_size, outline_color); viewport->draw_line(Point2(0, dragged_guide_pos.y), Point2(viewport->get_size().x, dragged_guide_pos.y), guide_color, Math::round(EDSCALE)); } } @@ -2791,7 +2791,7 @@ void CanvasItemEditor::_draw_rulers() { if (i % (major_subdivision * minor_subdivision) == 0) { viewport->draw_line(Point2(position.x, 0), Point2(position.x, RULER_WIDTH), graduation_color, Math::round(EDSCALE)); real_t val = (ruler_transform * major_subdivide * minor_subdivide).xform(Point2(i, 0)).x; - viewport->draw_string(font, Point2(position.x + 2, font->get_height(font_size)), TS->format_number(vformat(((int)val == val) ? "%d" : "%.1f", val)), HALIGN_LEFT, -1, font_size, font_color); + viewport->draw_string(font, Point2(position.x + 2, font->get_height(font_size)), TS->format_number(vformat(((int)val == val) ? "%d" : "%.1f", val)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color); } else { if (i % minor_subdivision == 0) { viewport->draw_line(Point2(position.x, RULER_WIDTH * 0.33), Point2(position.x, RULER_WIDTH), graduation_color, Math::round(EDSCALE)); @@ -2811,7 +2811,7 @@ void CanvasItemEditor::_draw_rulers() { Transform2D text_xform = Transform2D(-Math_PI / 2.0, Point2(font->get_height(font_size), position.y - 2)); viewport->draw_set_transform_matrix(viewport->get_transform() * text_xform); - viewport->draw_string(font, Point2(), TS->format_number(vformat(((int)val == val) ? "%d" : "%.1f", val)), HALIGN_LEFT, -1, font_size, font_color); + viewport->draw_string(font, Point2(), TS->format_number(vformat(((int)val == val) ? "%d" : "%.1f", val)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color); viewport->draw_set_transform_matrix(viewport->get_transform()); } else { @@ -2931,13 +2931,13 @@ void CanvasItemEditor::_draw_ruler_tool() { text_pos.y = CLAMP(text_pos.y, text_height * 1.5, viewport->get_rect().size.y - text_height * 1.5); if (begin.is_equal_approx(end)) { - viewport->draw_string(font, text_pos, (String)ruler_tool_origin, HALIGN_LEFT, -1, font_size, font_color, outline_size, outline_color); + viewport->draw_string(font, text_pos, (String)ruler_tool_origin, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color, outline_size, outline_color); Ref<Texture2D> position_icon = get_theme_icon(SNAME("EditorPosition"), SNAME("EditorIcons")); viewport->draw_texture(get_theme_icon(SNAME("EditorPosition"), SNAME("EditorIcons")), (ruler_tool_origin - view_offset) * zoom - position_icon->get_size() / 2); return; } - viewport->draw_string(font, text_pos, TS->format_number(vformat("%.1f px", length_vector.length())), HALIGN_LEFT, -1, font_size, font_color, outline_size, outline_color); + viewport->draw_string(font, text_pos, TS->format_number(vformat("%.1f px", length_vector.length())), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color, outline_size, outline_color); bool draw_secondary_lines = !(Math::is_equal_approx(begin.y, corner.y) || Math::is_equal_approx(end.x, corner.x)); @@ -2955,16 +2955,16 @@ void CanvasItemEditor::_draw_ruler_tool() { Point2 text_pos2 = text_pos; text_pos2.x = begin.x < text_pos.x ? MIN(text_pos.x - text_width, begin.x - text_width / 2) : MAX(text_pos.x + text_width, begin.x - text_width / 2); - viewport->draw_string(font, text_pos2, TS->format_number(vformat("%.1f px", length_vector.y)), HALIGN_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); + viewport->draw_string(font, text_pos2, TS->format_number(vformat("%.1f px", length_vector.y)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); Point2 v_angle_text_pos = Point2(); v_angle_text_pos.x = CLAMP(begin.x - angle_text_width / 2, angle_text_width / 2, viewport->get_rect().size.x - angle_text_width); v_angle_text_pos.y = begin.y < end.y ? MIN(text_pos2.y - 2 * text_height, begin.y - text_height * 0.5) : MAX(text_pos2.y + text_height * 3, begin.y + text_height * 1.5); - viewport->draw_string(font, v_angle_text_pos, TS->format_number(vformat(String::utf8("%d°"), vertical_angle)), HALIGN_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); + viewport->draw_string(font, v_angle_text_pos, TS->format_number(vformat(String::utf8("%d°"), vertical_angle)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); text_pos2 = text_pos; text_pos2.y = end.y < text_pos.y ? MIN(text_pos.y - text_height * 2, end.y - text_height / 2) : MAX(text_pos.y + text_height * 2, end.y - text_height / 2); - viewport->draw_string(font, text_pos2, TS->format_number(vformat("%.1f px", length_vector.x)), HALIGN_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); + viewport->draw_string(font, text_pos2, TS->format_number(vformat("%.1f px", length_vector.x)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); Point2 h_angle_text_pos = Point2(); h_angle_text_pos.x = CLAMP(end.x - angle_text_width / 2, angle_text_width / 2, viewport->get_rect().size.x - angle_text_width); @@ -2981,7 +2981,7 @@ void CanvasItemEditor::_draw_ruler_tool() { h_angle_text_pos.y = MIN(text_pos.y - height_multiplier * text_height, MIN(end.y - text_height * 0.5, text_pos2.y - height_multiplier * text_height)); } } - viewport->draw_string(font, h_angle_text_pos, TS->format_number(vformat(String::utf8("%d°"), horizontal_angle)), HALIGN_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); + viewport->draw_string(font, h_angle_text_pos, TS->format_number(vformat(String::utf8("%d°"), horizontal_angle)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); // Angle arcs int arc_point_count = 8; @@ -3016,17 +3016,17 @@ void CanvasItemEditor::_draw_ruler_tool() { text_pos.y = CLAMP(text_pos.y, text_height * 2.5, viewport->get_rect().size.y - text_height / 2); if (draw_secondary_lines) { - viewport->draw_string(font, text_pos, TS->format_number(vformat("%.2f " + TTR("units"), (length_vector / grid_step).length())), HALIGN_LEFT, -1, font_size, font_color, outline_size, outline_color); + viewport->draw_string(font, text_pos, TS->format_number(vformat("%.2f " + TTR("units"), (length_vector / grid_step).length())), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color, outline_size, outline_color); Point2 text_pos2 = text_pos; text_pos2.x = begin.x < text_pos.x ? MIN(text_pos.x - text_width, begin.x - text_width / 2) : MAX(text_pos.x + text_width, begin.x - text_width / 2); - viewport->draw_string(font, text_pos2, TS->format_number(vformat("%d " + TTR("units"), roundf(length_vector.y / grid_step.y))), HALIGN_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); + viewport->draw_string(font, text_pos2, TS->format_number(vformat("%d " + TTR("units"), roundf(length_vector.y / grid_step.y))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); text_pos2 = text_pos; text_pos2.y = end.y < text_pos.y ? MIN(text_pos.y - text_height * 2, end.y + text_height / 2) : MAX(text_pos.y + text_height * 2, end.y + text_height / 2); - viewport->draw_string(font, text_pos2, TS->format_number(vformat("%d " + TTR("units"), roundf(length_vector.x / grid_step.x))), HALIGN_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); + viewport->draw_string(font, text_pos2, TS->format_number(vformat("%d " + TTR("units"), roundf(length_vector.x / grid_step.x))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); } else { - viewport->draw_string(font, text_pos, TS->format_number(vformat("%d " + TTR("units"), roundf((length_vector / grid_step).length()))), HALIGN_LEFT, -1, font_size, font_color, outline_size, outline_color); + viewport->draw_string(font, text_pos, TS->format_number(vformat("%d " + TTR("units"), roundf((length_vector / grid_step).length()))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color, outline_size, outline_color); } } } else { @@ -3589,7 +3589,7 @@ void CanvasItemEditor::_draw_hover() { viewport->draw_texture(node_icon, pos, Color(1.0, 1.0, 1.0, 0.5)); // Draw name - viewport->draw_string(font, pos + Point2(node_icon->get_size().x + 4, item_size.y - 3), node_name, HALIGN_LEFT, -1, font_size, Color(1.0, 1.0, 1.0, 0.5)); + viewport->draw_string(font, pos + Point2(node_icon->get_size().x + 4, item_size.y - 3), node_name, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1.0, 1.0, 1.0, 0.5)); } } diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 0c269e9b07..3bb707d415 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -675,11 +675,11 @@ void CurveEditor::_draw() { // X axis float y = curve.get_min_value(); Vector2 off(0, font_height - 1); - draw_string(font, get_view_pos(Vector2(0, y)) + off, "0.0", HALIGN_LEFT, -1, font_size, text_color); - draw_string(font, get_view_pos(Vector2(0.25, y)) + off, "0.25", HALIGN_LEFT, -1, font_size, text_color); - draw_string(font, get_view_pos(Vector2(0.5, y)) + off, "0.5", HALIGN_LEFT, -1, font_size, text_color); - draw_string(font, get_view_pos(Vector2(0.75, y)) + off, "0.75", HALIGN_LEFT, -1, font_size, text_color); - draw_string(font, get_view_pos(Vector2(1, y)) + off, "1.0", HALIGN_LEFT, -1, font_size, text_color); + draw_string(font, get_view_pos(Vector2(0, y)) + off, "0.0", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color); + draw_string(font, get_view_pos(Vector2(0.25, y)) + off, "0.25", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color); + draw_string(font, get_view_pos(Vector2(0.5, y)) + off, "0.5", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color); + draw_string(font, get_view_pos(Vector2(0.75, y)) + off, "0.75", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color); + draw_string(font, get_view_pos(Vector2(1, y)) + off, "1.0", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color); } { @@ -688,9 +688,9 @@ void CurveEditor::_draw() { float m1 = 0.5 * (curve.get_min_value() + curve.get_max_value()); float m2 = curve.get_max_value(); Vector2 off(1, -1); - draw_string(font, get_view_pos(Vector2(0, m0)) + off, String::num(m0, 2), HALIGN_LEFT, -1, font_size, text_color); - draw_string(font, get_view_pos(Vector2(0, m1)) + off, String::num(m1, 2), HALIGN_LEFT, -1, font_size, text_color); - draw_string(font, get_view_pos(Vector2(0, m2)) + off, String::num(m2, 3), HALIGN_LEFT, -1, font_size, text_color); + draw_string(font, get_view_pos(Vector2(0, m0)) + off, String::num(m0, 2), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color); + draw_string(font, get_view_pos(Vector2(0, m1)) + off, String::num(m1, 2), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color); + draw_string(font, get_view_pos(Vector2(0, m2)) + off, String::num(m2, 3), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color); } // Draw tangents for current point @@ -750,10 +750,10 @@ void CurveEditor::_draw() { if (_selected_point > 0 && _selected_point + 1 < curve.get_point_count()) { text_color.a *= 0.4; - draw_string(font, Vector2(50 * EDSCALE, font_height), TTR("Hold Shift to edit tangents individually"), HALIGN_LEFT, -1, font_size, text_color); + draw_string(font, Vector2(50 * EDSCALE, font_height), TTR("Hold Shift to edit tangents individually"), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color); } else if (curve.get_point_count() == 0) { text_color.a *= 0.4; - draw_string(font, Vector2(50 * EDSCALE, font_height), TTR("Right click to add point"), HALIGN_LEFT, -1, font_size, text_color); + draw_string(font, Vector2(50 * EDSCALE, font_height), TTR("Right click to add point"), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color); } } diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 9702c7e734..31cb0cd18d 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -851,7 +851,7 @@ Ref<Texture2D> EditorFontPreviewPlugin::generate_from_path(const String &p_path, Ref<Font> font = sampled_font; - font->draw_string(canvas_item, pos, sample, HALIGN_LEFT, -1.f, 50, Color(1, 1, 1)); + font->draw_string(canvas_item, pos, sample, HORIZONTAL_ALIGNMENT_LEFT, -1.f, 50, Color(1, 1, 1)); RS::get_singleton()->connect(SNAME("frame_pre_draw"), callable_mp(const_cast<EditorFontPreviewPlugin *>(this), &EditorFontPreviewPlugin::_generate_frame_started), Vector<Variant>(), Object::CONNECT_ONESHOT); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index fb469b3e00..2f14447bf9 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -2987,7 +2987,7 @@ static void draw_indicator_bar(Control &surface, real_t fill, const Ref<Texture2 surface.draw_texture(icon, icon_pos); // Draw text below the bar (for speed/zoom information). - surface.draw_string(font, Vector2(icon_pos.x, icon_pos.y + icon_size.y + 16 * EDSCALE), text, HALIGN_LEFT, -1.f, font_size); + surface.draw_string(font, Vector2(icon_pos.x, icon_pos.y + icon_size.y + 16 * EDSCALE), text, HORIZONTAL_ALIGNMENT_LEFT, -1.f, font_size); } void Node3DEditorViewport::_draw() { @@ -3027,9 +3027,9 @@ void Node3DEditorViewport::_draw() { Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label")); int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label")); Point2 msgpos = Point2(5, get_size().y - 20); - font->draw_string(ci, msgpos + Point2(1, 1), message, HALIGN_LEFT, -1, font_size, Color(0, 0, 0, 0.8)); - font->draw_string(ci, msgpos + Point2(-1, -1), message, HALIGN_LEFT, -1, font_size, Color(0, 0, 0, 0.8)); - font->draw_string(ci, msgpos, message, HALIGN_LEFT, -1, font_size, Color(1, 1, 1, 1)); + font->draw_string(ci, msgpos + Point2(1, 1), message, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(0, 0, 0, 0.8)); + font->draw_string(ci, msgpos + Point2(-1, -1), message, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(0, 0, 0, 0.8)); + font->draw_string(ci, msgpos, message, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1, 1, 1, 1)); } if (_edit.mode == TRANSFORM_ROTATE) { @@ -4444,7 +4444,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, Edito cinema_label = memnew(Label); cinema_label->set_anchor_and_offset(SIDE_TOP, ANCHOR_BEGIN, 10 * EDSCALE); cinema_label->set_h_grow_direction(GROW_DIRECTION_END); - cinema_label->set_align(Label::ALIGN_CENTER); + cinema_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); surface->add_child(cinema_label); cinema_label->set_text(TTR("Cinematic Preview")); cinema_label->hide(); @@ -4455,7 +4455,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, Edito locked_label->set_anchor_and_offset(SIDE_BOTTOM, ANCHOR_END, -10 * EDSCALE); locked_label->set_h_grow_direction(GROW_DIRECTION_END); locked_label->set_v_grow_direction(GROW_DIRECTION_BEGIN); - locked_label->set_align(Label::ALIGN_CENTER); + locked_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); surface->add_child(locked_label); locked_label->set_text(TTR("View Rotation Locked")); locked_label->hide(); @@ -7661,7 +7661,7 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) { sun_title->set_theme_type_variation("HeaderSmall"); sun_vb->add_child(sun_title); sun_title->set_text(TTR("Preview Sun")); - sun_title->set_align(Label::ALIGN_CENTER); + sun_title->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); CenterContainer *sun_direction_center = memnew(CenterContainer); sun_direction = memnew(Control); @@ -7749,8 +7749,8 @@ void fragment() { sun_state = memnew(Label); sun_environ_hb->add_child(sun_state); - sun_state->set_align(Label::ALIGN_CENTER); - sun_state->set_valign(Label::VALIGN_CENTER); + sun_state->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + sun_state->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); sun_state->set_h_size_flags(SIZE_EXPAND_FILL); VSeparator *sc = memnew(VSeparator); @@ -7768,7 +7768,7 @@ void fragment() { environ_vb->add_child(environ_title); environ_title->set_text(TTR("Preview Environment")); - environ_title->set_align(Label::ALIGN_CENTER); + environ_title->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); environ_sky_color = memnew(ColorPickerButton); environ_sky_color->set_edit_alpha(false); @@ -7816,8 +7816,8 @@ void fragment() { environ_state = memnew(Label); sun_environ_hb->add_child(environ_state); - environ_state->set_align(Label::ALIGN_CENTER); - environ_state->set_valign(Label::VALIGN_CENTER); + environ_state->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + environ_state->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); environ_state->set_h_size_flags(SIZE_EXPAND_FILL); preview_sun = memnew(DirectionalLight3D); diff --git a/editor/plugins/physical_bone_3d_editor_plugin.cpp b/editor/plugins/physical_bone_3d_editor_plugin.cpp index b1e104e680..71955cf62c 100644 --- a/editor/plugins/physical_bone_3d_editor_plugin.cpp +++ b/editor/plugins/physical_bone_3d_editor_plugin.cpp @@ -51,7 +51,7 @@ PhysicalBone3DEditor::PhysicalBone3DEditor(EditorNode *p_editor) : editor(p_editor) { spatial_editor_hb = memnew(HBoxContainer); spatial_editor_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); - spatial_editor_hb->set_alignment(BoxContainer::ALIGN_BEGIN); + spatial_editor_hb->set_alignment(BoxContainer::ALIGNMENT_BEGIN); Node3DEditor::get_singleton()->add_control_to_menu_panel(spatial_editor_hb); spatial_editor_hb->add_child(memnew(VSeparator)); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 66b803e3ab..36bab83630 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -90,7 +90,7 @@ ConnectionInfoDialog::ConnectionInfoDialog() { add_child(vbc); method = memnew(Label); - method->set_align(Label::ALIGN_CENTER); + method->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); vbc->add_child(method); tree = memnew(Tree); diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index a13cbfa515..89016b8758 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -1115,7 +1115,7 @@ ThemeItemImportTree::ThemeItemImportTree() { label_set->add_child(select_items_label); HBoxContainer *button_set = memnew(HBoxContainer); - button_set->set_alignment(BoxContainer::ALIGN_END); + button_set->set_alignment(BoxContainer::ALIGNMENT_END); all_set->add_child(button_set); select_all_items_button->set_flat(true); select_all_items_button->set_tooltip(select_all_items_tooltip); @@ -1130,7 +1130,7 @@ ThemeItemImportTree::ThemeItemImportTree() { button_set->add_child(deselect_all_items_button); deselect_all_items_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_deselect_all_data_type_pressed), varray(i)); - total_selected_items_label->set_align(Label::ALIGN_RIGHT); + total_selected_items_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); total_selected_items_label->hide(); import_bulk_vb->add_child(total_selected_items_label); @@ -1783,7 +1783,7 @@ ThemeItemEditorDialog::ThemeItemEditorDialog() { set_hide_on_ok(false); // Closing may require a confirmation in some cases. tc = memnew(TabContainer); - tc->set_tab_align(TabContainer::TabAlign::ALIGN_LEFT); + tc->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); add_child(tc); // Edit Items tab. @@ -1909,8 +1909,8 @@ ThemeItemEditorDialog::ThemeItemEditorDialog() { edit_items_message = memnew(Label); edit_items_message->set_anchors_and_offsets_preset(Control::PRESET_WIDE); edit_items_message->set_mouse_filter(Control::MOUSE_FILTER_STOP); - edit_items_message->set_align(Label::ALIGN_CENTER); - edit_items_message->set_valign(Label::VALIGN_CENTER); + edit_items_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + edit_items_message->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); edit_items_message->set_autowrap_mode(Label::AUTOWRAP_WORD); edit_items_tree->add_child(edit_items_message); @@ -3129,7 +3129,7 @@ ThemeTypeEditor::ThemeTypeEditor() { type_variation_locked = memnew(Label); type_variation_vb->add_child(type_variation_locked); - type_variation_locked->set_align(Label::ALIGN_CENTER); + type_variation_locked->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); type_variation_locked->set_autowrap_mode(Label::AUTOWRAP_WORD); type_variation_locked->set_text(TTR("A type associated with a built-in class cannot be marked as a variation of another type.")); type_variation_locked->hide(); @@ -3329,7 +3329,7 @@ ThemeEditor::ThemeEditor() { preview_tabs_vb->add_child(preview_tabs_content); preview_tabs = memnew(TabBar); - preview_tabs->set_tab_align(TabBar::ALIGN_LEFT); + preview_tabs->set_tab_alignment(TabBar::ALIGNMENT_LEFT); preview_tabs->set_h_size_flags(SIZE_EXPAND_FILL); preview_tabbar_hb->add_child(preview_tabs); preview_tabs->connect("tab_changed", callable_mp(this, &ThemeEditor::_change_preview_tab)); diff --git a/editor/plugins/theme_editor_preview.cpp b/editor/plugins/theme_editor_preview.cpp index 52155a7136..9a5ecd3802 100644 --- a/editor/plugins/theme_editor_preview.cpp +++ b/editor/plugins/theme_editor_preview.cpp @@ -136,7 +136,7 @@ void ThemeEditorPreview::_draw_picker_overlay() { Point2 label_pos = highlight_label_rect.position; label_pos.y += highlight_label_rect.size.y - margin_bottom; label_pos.x += margin_left; - picker_overlay->draw_string(theme_cache.preview_picker_font, label_pos, highlight_name, HALIGN_LEFT, -1, theme_cache.font_size); + picker_overlay->draw_string(theme_cache.preview_picker_font, label_pos, highlight_name, HORIZONTAL_ALIGNMENT_LEFT, -1, theme_cache.font_size); } } @@ -365,7 +365,7 @@ DefaultThemeEditorPreview::DefaultThemeEditorPreview() { vhb->add_child(memnew(VSeparator)); VBoxContainer *hvb = memnew(VBoxContainer); vhb->add_child(hvb); - hvb->set_alignment(BoxContainer::ALIGN_CENTER); + hvb->set_alignment(BoxContainer::ALIGNMENT_CENTER); hvb->set_h_size_flags(SIZE_EXPAND_FILL); hvb->add_child(memnew(HSlider)); HScrollBar *hsb = memnew(HScrollBar); 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. diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index 28352d25eb..5336788d98 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -416,11 +416,11 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { set_up_ok_button->set_text(TTR("Close")); set_up_vbc = memnew(VBoxContainer); - set_up_vbc->set_alignment(VBoxContainer::ALIGN_CENTER); + set_up_vbc->set_alignment(BoxContainer::ALIGNMENT_CENTER); set_up_dialog->add_child(set_up_vbc); set_up_hbc = memnew(HBoxContainer); - set_up_hbc->set_h_size_flags(HBoxContainer::SIZE_EXPAND_FILL); + set_up_hbc->set_h_size_flags(BoxContainer::SIZE_EXPAND_FILL); set_up_vbc->add_child(set_up_hbc); set_up_vcs_status = memnew(RichTextLabel); @@ -447,7 +447,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { version_commit_dock->set_visible(false); commit_box_vbc = memnew(VBoxContainer); - commit_box_vbc->set_alignment(VBoxContainer::ALIGN_BEGIN); + commit_box_vbc->set_alignment(VBoxContainer::ALIGNMENT_BEGIN); commit_box_vbc->set_h_size_flags(VBoxContainer::SIZE_EXPAND_FILL); commit_box_vbc->set_v_size_flags(VBoxContainer::SIZE_EXPAND_FILL); version_commit_dock->add_child(commit_box_vbc); @@ -530,7 +530,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { commit_box_vbc->add_child(commit_button); commit_status = memnew(Label); - commit_status->set_align(Label::ALIGN_CENTER); + commit_status->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); commit_box_vbc->add_child(commit_status); version_control_dock = memnew(PanelContainer); @@ -555,7 +555,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { diff_file_name = memnew(Label); diff_file_name->set_text(TTR("No file diff is active")); diff_file_name->set_h_size_flags(Label::SIZE_EXPAND_FILL); - diff_file_name->set_align(Label::ALIGN_RIGHT); + diff_file_name->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); diff_hbc->add_child(diff_file_name); diff_refresh_button = memnew(Button); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index ca84fa1cf0..7673c31d00 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -4247,8 +4247,8 @@ VisualShaderEditor::VisualShaderEditor() { alert = memnew(AcceptDialog); alert->get_label()->set_autowrap_mode(Label::AUTOWRAP_WORD); - alert->get_label()->set_align(Label::ALIGN_CENTER); - alert->get_label()->set_valign(Label::VALIGN_CENTER); + alert->get_label()->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + alert->get_label()->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); alert->get_label()->set_custom_minimum_size(Size2(400, 60) * EDSCALE); add_child(alert); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index a97d38323e..20990cc301 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -1073,7 +1073,7 @@ ProjectExportDialog::ProjectExportDialog() { // Subsections. sections = memnew(TabContainer); - sections->set_tab_align(TabContainer::ALIGN_LEFT); + sections->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); sections->set_use_hidden_tabs_for_min_size(true); settings_vb->add_child(sections); sections->set_v_size_flags(Control::SIZE_EXPAND_FILL); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 341b59779d..e6964a8337 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -850,7 +850,7 @@ public: iphb->add_child(install_browse); msg = memnew(Label); - msg->set_align(Label::ALIGN_CENTER); + msg->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); vb->add_child(msg); // rasterizer selection @@ -904,8 +904,8 @@ public: l->set_text(TTR("The renderer can be changed later, but scenes may need to be adjusted.")); // Add some extra spacing to separate it from the list above and the buttons below. l->set_custom_minimum_size(Size2(0, 40) * EDSCALE); - l->set_align(Label::ALIGN_CENTER); - l->set_valign(Label::VALIGN_CENTER); + l->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + l->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); l->set_modulate(Color(1, 1, 1, 0.7)); rasterizer_container->add_child(l); @@ -1361,7 +1361,7 @@ void ProjectList::create_project_item_control(int p_index) { favorite->set_mouse_filter(MOUSE_FILTER_PASS); favorite->connect("pressed", callable_mp(this, &ProjectList::_favorite_pressed), varray(hb)); favorite_box->add_child(favorite); - favorite_box->set_alignment(BoxContainer::ALIGN_CENTER); + favorite_box->set_alignment(BoxContainer::ALIGNMENT_CENTER); hb->add_child(favorite_box); hb->favorite_button = favorite; hb->set_is_favorite(item.favorite); @@ -1408,7 +1408,7 @@ void ProjectList::create_project_item_control(int p_index) { unsupported_label->add_theme_font_override("font", get_theme_font(SNAME("title"), SNAME("EditorFonts"))); unsupported_label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor"))); unsupported_label->set_clip_text(true); - unsupported_label->set_align(Label::ALIGN_RIGHT); + unsupported_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); title_hb->add_child(unsupported_label); Control *spacer = memnew(Control()); spacer->set_custom_minimum_size(Size2(10, 10)); @@ -2134,7 +2134,7 @@ void ProjectManager::_open_selected_projects_ask() { PackedStringArray unsupported_features = project.unsupported_features; Label *ask_update_label = ask_update_settings->get_label(); - ask_update_label->set_align(Label::ALIGN_LEFT); // Reset in case of previous center align. + ask_update_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_LEFT); // Reset in case of previous center align. // Check if the config_version property was empty or 0 if (config_version == 0) { @@ -2178,7 +2178,7 @@ void ProjectManager::_open_selected_projects_ask() { warning_message += vformat(TTR("Warning: This project uses the following features not supported by this build of Godot:\n\n%s\n\n"), unsupported_features_str); } warning_message += TTR("Open anyway? Project will be modified."); - ask_update_label->set_align(Label::ALIGN_CENTER); + ask_update_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); ask_update_settings->set_text(warning_message); ask_update_settings->popup_centered(); return; @@ -2537,7 +2537,7 @@ ProjectManager::ProjectManager() { tabs = memnew(TabContainer); center_box->add_child(tabs); tabs->set_anchors_and_offsets_preset(Control::PRESET_WIDE); - tabs->set_tab_align(TabContainer::ALIGN_LEFT); + tabs->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); tabs->connect("tab_changed", callable_mp(this, &ProjectManager::_on_tab_changed)); HBoxContainer *projects_hb = memnew(HBoxContainer); @@ -2666,7 +2666,7 @@ ProjectManager::ProjectManager() { { // Version info and language options settings_hb = memnew(HBoxContainer); - settings_hb->set_alignment(BoxContainer::ALIGN_END); + settings_hb->set_alignment(BoxContainer::ALIGNMENT_END); settings_hb->set_h_grow_direction(Control::GROW_DIRECTION_BEGIN); settings_hb->set_anchors_and_offsets_preset(Control::PRESET_TOP_RIGHT); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index db12e90540..519427787d 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -513,13 +513,13 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { data = p_data; tab_container = memnew(TabContainer); - tab_container->set_tab_align(TabContainer::ALIGN_LEFT); + tab_container->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); tab_container->set_use_hidden_tabs_for_min_size(true); add_child(tab_container); VBoxContainer *general_editor = memnew(VBoxContainer); general_editor->set_name(TTR("General")); - general_editor->set_alignment(BoxContainer::ALIGN_BEGIN); + general_editor->set_alignment(BoxContainer::ALIGNMENT_BEGIN); general_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); tab_container->add_child(general_editor); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 061f4d218a..01eae1e4ec 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -1410,7 +1410,7 @@ void CustomPropertyEditor::_draw_easing() { prev = h; } - f->draw_string(ci, Point2(10, 10 + f->get_ascent(font_size)), String::num(exp, 2), HALIGN_LEFT, -1, font_size, color); + f->draw_string(ci, Point2(10, 10 + f->get_ascent(font_size)), String::num(exp, 2), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color); } void CustomPropertyEditor::_text_edit_changed() { @@ -1864,7 +1864,7 @@ CustomPropertyEditor::CustomPropertyEditor() { slider->connect("value_changed", callable_mp(this, &CustomPropertyEditor::_range_modified)); action_hboxes = memnew(HBoxContainer); - action_hboxes->set_alignment(BoxContainer::ALIGN_CENTER); + action_hboxes->set_alignment(BoxContainer::ALIGNMENT_CENTER); value_vbox->add_child(action_hboxes); for (int i = 0; i < MAX_ACTION_BUTTONS; i++) { action_buttons[i] = memnew(Button); diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp index eb73f88e61..8cf5a26c55 100644 --- a/editor/rename_dialog.cpp +++ b/editor/rename_dialog.cpp @@ -114,7 +114,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_und vbc->add_child(cbut_collapse_features); tabc_features = memnew(TabContainer); - tabc_features->set_tab_align(TabContainer::ALIGN_LEFT); + tabc_features->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); tabc_features->set_use_hidden_tabs_for_min_size(true); vbc->add_child(tabc_features); diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index fb1575ad8c..afb1d5107c 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -907,8 +907,8 @@ ScriptCreateDialog::ScriptCreateDialog() { get_ok_button()->set_text(TTR("Create")); alert = memnew(AcceptDialog); alert->get_label()->set_autowrap_mode(Label::AUTOWRAP_WORD_SMART); - alert->get_label()->set_align(Label::ALIGN_CENTER); - alert->get_label()->set_valign(Label::VALIGN_CENTER); + alert->get_label()->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + alert->get_label()->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); alert->get_label()->set_custom_minimum_size(Size2(325, 60) * EDSCALE); add_child(alert); diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index e1229729ac..a39fdb3878 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -622,7 +622,7 @@ EditorSettingsDialog::EditorSettingsDialog() { undo_redo = memnew(UndoRedo); tabs = memnew(TabContainer); - tabs->set_tab_align(TabContainer::ALIGN_LEFT); + tabs->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); tabs->connect("tab_changed", callable_mp(this, &EditorSettingsDialog::_tabs_tab_changed)); add_child(tabs); diff --git a/editor/shader_create_dialog.cpp b/editor/shader_create_dialog.cpp index 1ddd79eea8..a958226394 100644 --- a/editor/shader_create_dialog.cpp +++ b/editor/shader_create_dialog.cpp @@ -630,8 +630,8 @@ ShaderCreateDialog::ShaderCreateDialog() { alert = memnew(AcceptDialog); alert->get_label()->set_autowrap_mode(Label::AUTOWRAP_WORD_SMART); - alert->get_label()->set_align(Label::ALIGN_CENTER); - alert->get_label()->set_valign(Label::VALIGN_CENTER); + alert->get_label()->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + alert->get_label()->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); alert->get_label()->set_custom_minimum_size(Size2(325, 60) * EDSCALE); add_child(alert); |