align to horizontal_alignment, valign to vertical_alignment, related

This commit is contained in:
Nathan Franke 2021-11-24 20:58:47 -06:00
parent f1e3c87244
commit 41a20171eb
No known key found for this signature in database
GPG key ID: 92164DCCF3B1F723
130 changed files with 861 additions and 1011 deletions

View file

@ -142,27 +142,28 @@ void register_global_constants() {
BIND_CORE_ENUM_CONSTANT(CLOCKWISE);
BIND_CORE_ENUM_CONSTANT(COUNTERCLOCKWISE);
BIND_CORE_ENUM_CONSTANT(HALIGN_LEFT);
BIND_CORE_ENUM_CONSTANT(HALIGN_CENTER);
BIND_CORE_ENUM_CONSTANT(HALIGN_RIGHT);
BIND_CORE_ENUM_CONSTANT(HALIGN_FILL);
BIND_CORE_ENUM_CONSTANT(HORIZONTAL_ALIGNMENT_LEFT);
BIND_CORE_ENUM_CONSTANT(HORIZONTAL_ALIGNMENT_CENTER);
BIND_CORE_ENUM_CONSTANT(HORIZONTAL_ALIGNMENT_RIGHT);
BIND_CORE_ENUM_CONSTANT(HORIZONTAL_ALIGNMENT_FILL);
BIND_CORE_ENUM_CONSTANT(VALIGN_TOP);
BIND_CORE_ENUM_CONSTANT(VALIGN_CENTER);
BIND_CORE_ENUM_CONSTANT(VALIGN_BOTTOM);
BIND_CORE_ENUM_CONSTANT(VERTICAL_ALIGNMENT_TOP);
BIND_CORE_ENUM_CONSTANT(VERTICAL_ALIGNMENT_CENTER);
BIND_CORE_ENUM_CONSTANT(VERTICAL_ALIGNMENT_BOTTOM);
BIND_CORE_ENUM_CONSTANT(VERTICAL_ALIGNMENT_FILL);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGN_TOP_TO);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGN_CENTER_TO);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGN_BOTTOM_TO);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TOP_TO);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_CENTER_TO);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_BOTTOM_TO);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGN_TO_TOP);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGN_TO_CENTER);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGN_TO_BASELINE);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGN_TO_BOTTOM);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TO_TOP);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TO_CENTER);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TO_BASELINE);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TO_BOTTOM);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGN_TOP);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGN_CENTER);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGN_BOTTOM);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_TOP);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_CENTER);
BIND_CORE_ENUM_CONSTANT(INLINE_ALIGNMENT_BOTTOM);
BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, SPECIAL);
BIND_CORE_ENUM_CLASS_CONSTANT(Key, KEY, ESCAPE);

View file

@ -68,37 +68,38 @@ enum Orientation {
VERTICAL
};
enum HAlign {
HALIGN_LEFT,
HALIGN_CENTER,
HALIGN_RIGHT,
HALIGN_FILL,
enum HorizontalAlignment {
HORIZONTAL_ALIGNMENT_LEFT,
HORIZONTAL_ALIGNMENT_CENTER,
HORIZONTAL_ALIGNMENT_RIGHT,
HORIZONTAL_ALIGNMENT_FILL,
};
enum VAlign {
VALIGN_TOP,
VALIGN_CENTER,
VALIGN_BOTTOM
enum VerticalAlignment {
VERTICAL_ALIGNMENT_TOP,
VERTICAL_ALIGNMENT_CENTER,
VERTICAL_ALIGNMENT_BOTTOM,
VERTICAL_ALIGNMENT_FILL,
};
enum InlineAlign {
enum InlineAlignment {
// Image alignment points.
INLINE_ALIGN_TOP_TO = 0b0000,
INLINE_ALIGN_CENTER_TO = 0b0001,
INLINE_ALIGN_BOTTOM_TO = 0b0010,
INLINE_ALIGN_IMAGE_MASK = 0b0011,
INLINE_ALIGNMENT_TOP_TO = 0b0000,
INLINE_ALIGNMENT_CENTER_TO = 0b0001,
INLINE_ALIGNMENT_BOTTOM_TO = 0b0010,
INLINE_ALIGNMENT_IMAGE_MASK = 0b0011,
// Text alignment points.
INLINE_ALIGN_TO_TOP = 0b0000,
INLINE_ALIGN_TO_CENTER = 0b0100,
INLINE_ALIGN_TO_BASELINE = 0b1000,
INLINE_ALIGN_TO_BOTTOM = 0b1100,
INLINE_ALIGN_TEXT_MASK = 0b1100,
INLINE_ALIGNMENT_TO_TOP = 0b0000,
INLINE_ALIGNMENT_TO_CENTER = 0b0100,
INLINE_ALIGNMENT_TO_BASELINE = 0b1000,
INLINE_ALIGNMENT_TO_BOTTOM = 0b1100,
INLINE_ALIGNMENT_TEXT_MASK = 0b1100,
// Presets.
INLINE_ALIGN_TOP = INLINE_ALIGN_TOP_TO | INLINE_ALIGN_TO_TOP,
INLINE_ALIGN_CENTER = INLINE_ALIGN_CENTER_TO | INLINE_ALIGN_TO_CENTER,
INLINE_ALIGN_BOTTOM = INLINE_ALIGN_BOTTOM_TO | INLINE_ALIGN_TO_BOTTOM
INLINE_ALIGNMENT_TOP = INLINE_ALIGNMENT_TOP_TO | INLINE_ALIGNMENT_TO_TOP,
INLINE_ALIGNMENT_CENTER = INLINE_ALIGNMENT_CENTER_TO | INLINE_ALIGNMENT_TO_CENTER,
INLINE_ALIGNMENT_BOTTOM = INLINE_ALIGNMENT_BOTTOM_TO | INLINE_ALIGNMENT_TO_BOTTOM
};
enum Side {

View file

@ -106,9 +106,9 @@ VARIANT_ENUM_CAST(KeyModifierMask);
VARIANT_ENUM_CAST(MIDIMessage);
VARIANT_ENUM_CAST(MouseButton);
VARIANT_ENUM_CAST(Orientation);
VARIANT_ENUM_CAST(HAlign);
VARIANT_ENUM_CAST(VAlign);
VARIANT_ENUM_CAST(InlineAlign);
VARIANT_ENUM_CAST(HorizontalAlignment);
VARIANT_ENUM_CAST(VerticalAlignment);
VARIANT_ENUM_CAST(InlineAlignment);
VARIANT_ENUM_CAST(PropertyHint);
VARIANT_ENUM_CAST(PropertyUsageFlags);
VARIANT_ENUM_CAST(Variant::Type);

View file

@ -1210,56 +1210,59 @@
</constant>
<constant name="COUNTERCLOCKWISE" value="1" enum="ClockDirection">
</constant>
<constant name="HALIGN_LEFT" value="0" enum="HAlign">
<constant name="HORIZONTAL_ALIGNMENT_LEFT" value="0" enum="HorizontalAlignment">
Horizontal left alignment, usually for text-derived classes.
</constant>
<constant name="HALIGN_CENTER" value="1" enum="HAlign">
<constant name="HORIZONTAL_ALIGNMENT_CENTER" value="1" enum="HorizontalAlignment">
Horizontal center alignment, usually for text-derived classes.
</constant>
<constant name="HALIGN_RIGHT" value="2" enum="HAlign">
<constant name="HORIZONTAL_ALIGNMENT_RIGHT" value="2" enum="HorizontalAlignment">
Horizontal right alignment, usually for text-derived classes.
</constant>
<constant name="HALIGN_FILL" value="3" enum="HAlign">
<constant name="HORIZONTAL_ALIGNMENT_FILL" value="3" enum="HorizontalAlignment">
Expand row to fit width, usually for text-derived classes.
</constant>
<constant name="VALIGN_TOP" value="0" enum="VAlign">
<constant name="VERTICAL_ALIGNMENT_TOP" value="0" enum="VerticalAlignment">
Vertical top alignment, usually for text-derived classes.
</constant>
<constant name="VALIGN_CENTER" value="1" enum="VAlign">
<constant name="VERTICAL_ALIGNMENT_CENTER" value="1" enum="VerticalAlignment">
Vertical center alignment, usually for text-derived classes.
</constant>
<constant name="VALIGN_BOTTOM" value="2" enum="VAlign">
<constant name="VERTICAL_ALIGNMENT_BOTTOM" value="2" enum="VerticalAlignment">
Vertical bottom alignment, usually for text-derived classes.
</constant>
<constant name="INLINE_ALIGN_TOP_TO" value="0" enum="InlineAlign">
Aligns the top of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGN_TO_*[/code] constant.
<constant name="VERTICAL_ALIGNMENT_FILL" value="3" enum="VerticalAlignment">
Expand rows to fit height, usually for text-derived classes.
</constant>
<constant name="INLINE_ALIGN_CENTER_TO" value="1" enum="InlineAlign">
Aligns the center of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGN_TO_*[/code] constant.
<constant name="INLINE_ALIGNMENT_TOP_TO" value="0" enum="InlineAlignment">
Aligns the top of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGNMENT_TO_*[/code] constant.
</constant>
<constant name="INLINE_ALIGN_BOTTOM_TO" value="2" enum="InlineAlign">
Aligns the bottom of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGN_TO_*[/code] constant.
<constant name="INLINE_ALIGNMENT_CENTER_TO" value="1" enum="InlineAlignment">
Aligns the center of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGNMENT_TO_*[/code] constant.
</constant>
<constant name="INLINE_ALIGN_TO_TOP" value="0" enum="InlineAlign">
Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGN_*_TO[/code] constant to the top of the text.
<constant name="INLINE_ALIGNMENT_BOTTOM_TO" value="2" enum="InlineAlignment">
Aligns the bottom of the inline object (e.g. image, table) to the position of the text specified by [code]INLINE_ALIGNMENT_TO_*[/code] constant.
</constant>
<constant name="INLINE_ALIGN_TO_CENTER" value="4" enum="InlineAlign">
Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGN_*_TO[/code] constant to the center of the text.
<constant name="INLINE_ALIGNMENT_TO_TOP" value="0" enum="InlineAlignment">
Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGNMENT_*_TO[/code] constant to the top of the text.
</constant>
<constant name="INLINE_ALIGN_TO_BASELINE" value="8" enum="InlineAlign">
Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGN_*_TO[/code] constant to the baseline of the text.
<constant name="INLINE_ALIGNMENT_TO_CENTER" value="4" enum="InlineAlignment">
Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGNMENT_*_TO[/code] constant to the center of the text.
</constant>
<constant name="INLINE_ALIGN_TO_BOTTOM" value="12" enum="InlineAlign">
<constant name="INLINE_ALIGNMENT_TO_BASELINE" value="8" enum="InlineAlignment">
Aligns the position of the inline object (e.g. image, table) specified by [code]INLINE_ALIGNMENT_*_TO[/code] constant to the baseline of the text.
</constant>
<constant name="INLINE_ALIGNMENT_TO_BOTTOM" value="12" enum="InlineAlignment">
Aligns inline object (e.g. image, table) to the bottom of the text.
</constant>
<constant name="INLINE_ALIGN_TOP" value="0" enum="InlineAlign">
Aligns top of the inline object (e.g. image, table) to the top of the text. Equvalent to [code]INLINE_ALIGN_TOP_TO | INLINE_ALIGN_TO_TOP[/code].
<constant name="INLINE_ALIGNMENT_TOP" value="0" enum="InlineAlignment">
Aligns top of the inline object (e.g. image, table) to the top of the text. Equvalent to [code]INLINE_ALIGNMENT_TOP_TO | INLINE_ALIGNMENT_TO_TOP[/code].
</constant>
<constant name="INLINE_ALIGN_CENTER" value="5" enum="InlineAlign">
Aligns center of the inline object (e.g. image, table) to the center of the text. Equvalent to [code]INLINE_ALIGN_CENTER_TO | INLINE_ALIGN_TO_CENTER[/code].
<constant name="INLINE_ALIGNMENT_CENTER" value="5" enum="InlineAlignment">
Aligns center of the inline object (e.g. image, table) to the center of the text. Equvalent to [code]INLINE_ALIGNMENT_CENTER_TO | INLINE_ALIGNMENT_TO_CENTER[/code].
</constant>
<constant name="INLINE_ALIGN_BOTTOM" value="14" enum="InlineAlign">
Aligns bottom of the inline object (e.g. image, table) to the bottom of the text. Equvalent to [code]INLINE_ALIGN_BOTTOM_TO | INLINE_ALIGN_TO_BOTTOM[/code].
<constant name="INLINE_ALIGNMENT_BOTTOM" value="14" enum="InlineAlignment">
Aligns bottom of the inline object (e.g. image, table) to the bottom of the text. Equvalent to [code]INLINE_ALIGNMENT_BOTTOM_TO | INLINE_ALIGNMENT_TO_BOTTOM[/code].
</constant>
<constant name="KEY_SPECIAL" value="16777216" enum="Key">
Keycodes with this bit applied are non-printable.

View file

@ -9,10 +9,10 @@
<tutorials>
</tutorials>
<members>
<member name="alignment_horizontal" type="int" setter="set_alignment_horizontal" getter="get_alignment_horizontal" enum="AspectRatioContainer.AlignMode" default="1">
<member name="alignment_horizontal" type="int" setter="set_alignment_horizontal" getter="get_alignment_horizontal" enum="AspectRatioContainer.AlignmentMode" default="1">
Specifies the horizontal relative position of child controls.
</member>
<member name="alignment_vertical" type="int" setter="set_alignment_vertical" getter="get_alignment_vertical" enum="AspectRatioContainer.AlignMode" default="1">
<member name="alignment_vertical" type="int" setter="set_alignment_vertical" getter="get_alignment_vertical" enum="AspectRatioContainer.AlignmentMode" default="1">
Specifies the vertical relative position of child controls.
</member>
<member name="ratio" type="float" setter="set_ratio" getter="get_ratio" default="1.0">
@ -36,13 +36,13 @@
The width and height of child controls is automatically adjusted to make their bounding rectangle cover the entire area of the container while keeping the aspect ratio.
When the bounding rectangle of child controls exceed the container's size and [member Control.rect_clip_content] is enabled, this allows to show only the container's area restricted by its own bounding rectangle.
</constant>
<constant name="ALIGN_BEGIN" value="0" enum="AlignMode">
<constant name="ALIGNMENT_BEGIN" value="0" enum="AlignmentMode">
Aligns child controls with the beginning (left or top) of the container.
</constant>
<constant name="ALIGN_CENTER" value="1" enum="AlignMode">
<constant name="ALIGNMENT_CENTER" value="1" enum="AlignmentMode">
Aligns child controls with the center of the container.
</constant>
<constant name="ALIGN_END" value="2" enum="AlignMode">
<constant name="ALIGNMENT_END" value="2" enum="AlignmentMode">
Aligns child controls with the end (right or bottom) of the container.
</constant>
</constants>

View file

@ -18,19 +18,16 @@
</method>
</methods>
<members>
<member name="alignment" type="int" setter="set_alignment" getter="get_alignment" enum="BoxContainer.AlignMode" default="0">
The alignment of the container's children (must be one of [constant ALIGN_BEGIN], [constant ALIGN_CENTER], or [constant ALIGN_END]).
<member name="alignment" type="int" setter="set_alignment" getter="get_alignment" enum="BoxContainer.AlignmentMode" default="0">
The alignment of the container's children (must be one of [constant ALIGNMENT_BEGIN], [constant ALIGNMENT_CENTER], or [constant ALIGNMENT_END]).
</member>
</members>
<constants>
<constant name="ALIGN_BEGIN" value="0" enum="AlignMode">
Aligns children with the beginning of the container.
<constant name="ALIGNMENT_BEGIN" value="0" enum="AlignmentMode">
</constant>
<constant name="ALIGN_CENTER" value="1" enum="AlignMode">
Aligns children with the center of the container.
<constant name="ALIGNMENT_CENTER" value="1" enum="AlignmentMode">
</constant>
<constant name="ALIGN_END" value="2" enum="AlignMode">
Aligns children with the end of the container.
<constant name="ALIGNMENT_END" value="2" enum="AlignmentMode">
</constant>
</constants>
</class>

View file

@ -64,8 +64,8 @@
</method>
</methods>
<members>
<member name="align" type="int" setter="set_text_align" getter="get_text_align" enum="Button.TextAlign" default="1">
Text alignment policy for the button's text, use one of the [enum TextAlign] constants.
<member name="alignment" type="int" setter="set_text_alignment" getter="get_text_alignment" enum="HorizontalAlignment" default="1">
Text alignment policy for the button's text, use one of the [enum @GlobalScope.HorizontalAlignment] constants.
</member>
<member name="clip_text" type="bool" setter="set_clip_text" getter="get_clip_text" default="false">
When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text.
@ -80,8 +80,8 @@
Button's icon, if text is present the icon will be placed before the text.
To edit margin and spacing of the icon, use [theme_item hseparation] theme property and [code]content_margin_*[/code] properties of the used [StyleBox]es.
</member>
<member name="icon_align" type="int" setter="set_icon_align" getter="get_icon_align" enum="Button.TextAlign" default="0">
Specifies if the icon should be aligned to the left, right, or center of a button. Uses the same [enum TextAlign] constants as the text alignment. If centered, text will draw on top of the icon.
<member name="icon_alignment" type="int" setter="set_icon_alignment" getter="get_icon_alignment" enum="HorizontalAlignment" default="0">
Specifies if the icon should be aligned to the left, right, or center of a button. Uses the same [enum @GlobalScope.HorizontalAlignment] constants as the text alignment. If centered, text will draw on top of the icon.
</member>
<member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
@ -93,17 +93,6 @@
Base text writing direction.
</member>
</members>
<constants>
<constant name="ALIGN_LEFT" value="0" enum="TextAlign">
Align the text to the left.
</constant>
<constant name="ALIGN_CENTER" value="1" enum="TextAlign">
Align the text to the center.
</constant>
<constant name="ALIGN_RIGHT" value="2" enum="TextAlign">
Align the text to the right.
</constant>
</constants>
<theme_items>
<theme_item name="font_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)">
Default text [Color] of the [Button].

View file

@ -143,7 +143,7 @@
<argument index="0" name="font" type="Font" />
<argument index="1" name="pos" type="Vector2" />
<argument index="2" name="text" type="String" />
<argument index="3" name="align" type="int" enum="HAlign" default="0" />
<argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" />
<argument index="4" name="width" type="float" default="-1" />
<argument index="5" name="max_lines" type="int" default="-1" />
<argument index="6" name="size" type="int" default="16" />
@ -236,7 +236,7 @@
<argument index="0" name="font" type="Font" />
<argument index="1" name="pos" type="Vector2" />
<argument index="2" name="text" type="String" />
<argument index="3" name="align" type="int" enum="HAlign" default="0" />
<argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" />
<argument index="4" name="width" type="float" default="-1" />
<argument index="5" name="size" type="int" default="16" />
<argument index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
@ -253,7 +253,7 @@
# so the Control is only created once.
var default_font = Control.new().get_font("font")
var default_font_size = Control.new().get_font_size("font_size")
draw_string(default_font, Vector2(64, 64), "Hello world", HALIGN_LEFT, -1, font_size)
draw_string(default_font, Vector2(64, 64), "Hello world", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size)
[/gdscript]
[csharp]
// If using this method in a script that redraws constantly, move the
@ -261,7 +261,7 @@
// so the Control is only created once.
Font defaultFont = new Control().GetFont("font");
int defaultFontSize = new Control().GetFontSize("font_size");
DrawString(defaultFont, new Vector2(64, 64), "Hello world", HALIGN_LEFT, -1, defaultFontSize);
DrawString(defaultFont, new Vector2(64, 64), "Hello world", HORIZONTAL_ALIGNMENT_LEFT, -1, defaultFontSize);
[/csharp]
[/codeblocks]
See also [method Font.draw_string].

View file

@ -10,7 +10,7 @@
<tutorials>
</tutorials>
<members>
<member name="align" type="int" setter="set_text_align" getter="get_text_align" overrides="Button" enum="Button.TextAlign" default="0" />
<member name="alignment" type="int" setter="set_text_alignment" getter="get_text_alignment" overrides="Button" enum="HorizontalAlignment" default="0" />
<member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" overrides="BaseButton" default="true" />
</members>
<theme_items>

View file

@ -10,7 +10,7 @@
<tutorials>
</tutorials>
<members>
<member name="align" type="int" setter="set_text_align" getter="get_text_align" overrides="Button" enum="Button.TextAlign" default="0" />
<member name="alignment" type="int" setter="set_text_alignment" getter="get_text_alignment" overrides="Button" enum="HorizontalAlignment" default="0" />
<member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" overrides="BaseButton" default="true" />
</members>
<theme_items>

View file

@ -96,7 +96,7 @@
<argument index="0" name="canvas_item" type="RID" />
<argument index="1" name="pos" type="Vector2" />
<argument index="2" name="text" type="String" />
<argument index="3" name="align" type="int" enum="HAlign" default="0" />
<argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" />
<argument index="4" name="width" type="float" default="-1" />
<argument index="5" name="max_lines" type="int" default="-1" />
<argument index="6" name="size" type="int" default="16" />
@ -114,7 +114,7 @@
<argument index="0" name="canvas_item" type="RID" />
<argument index="1" name="pos" type="Vector2" />
<argument index="2" name="text" type="String" />
<argument index="3" name="align" type="int" enum="HAlign" default="0" />
<argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" />
<argument index="4" name="width" type="float" default="-1" />
<argument index="5" name="size" type="int" default="16" />
<argument index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
@ -202,7 +202,7 @@
<return type="Vector2" />
<argument index="0" name="text" type="String" />
<argument index="1" name="size" type="int" default="16" />
<argument index="2" name="align" type="int" enum="HAlign" default="0" />
<argument index="2" name="alignment" type="int" enum="HorizontalAlignment" default="0" />
<argument index="3" name="width" type="float" default="-1" />
<argument index="4" name="flags" type="int" default="3" />
<description>

View file

@ -61,15 +61,15 @@
</method>
</methods>
<members>
<member name="align" type="int" setter="set_align" getter="get_align" enum="Label.Align" default="0">
Controls the text's horizontal align. Supports left, center, right, and fill, or justify. Set it to one of the [enum Align] constants.
</member>
<member name="autowrap_mode" type="int" setter="set_autowrap_mode" getter="get_autowrap_mode" enum="Label.AutowrapMode" default="0">
If set to something other than [constant AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see [enum AutowrapMode].
</member>
<member name="clip_text" type="bool" setter="set_clip_text" getter="is_clipping_text" default="false">
If [code]true[/code], the Label only shows the text that fits inside its bounding rectangle and will clip text horizontally.
</member>
<member name="horizontal_alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0">
Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants.
</member>
<member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
</member>
@ -102,38 +102,14 @@
<member name="uppercase" type="bool" setter="set_uppercase" getter="is_uppercase" default="false">
If [code]true[/code], all the text displays as UPPERCASE.
</member>
<member name="valign" type="int" setter="set_valign" getter="get_valign" enum="Label.VAlign" default="0">
Controls the text's vertical align. Supports top, center, bottom, and fill. Set it to one of the [enum VAlign] constants.
<member name="vertical_alignment" type="int" setter="set_vertical_alignment" getter="get_vertical_alignment" enum="VerticalAlignment" default="0">
Controls the text's vertical alignment. Supports top, center, bottom, and fill. Set it to one of the [enum VerticalAlignment] constants.
</member>
<member name="visible_characters" type="int" setter="set_visible_characters" getter="get_visible_characters" default="-1">
Restricts the number of characters to display. Set to -1 to disable.
</member>
</members>
<constants>
<constant name="ALIGN_LEFT" value="0" enum="Align">
Align rows to the left (default).
</constant>
<constant name="ALIGN_CENTER" value="1" enum="Align">
Align rows centered.
</constant>
<constant name="ALIGN_RIGHT" value="2" enum="Align">
Align rows to the right.
</constant>
<constant name="ALIGN_FILL" value="3" enum="Align">
Expand row to fit the width.
</constant>
<constant name="VALIGN_TOP" value="0" enum="VAlign">
Align the whole text to the top.
</constant>
<constant name="VALIGN_CENTER" value="1" enum="VAlign">
Align the whole text to the center.
</constant>
<constant name="VALIGN_BOTTOM" value="2" enum="VAlign">
Align the whole text to the bottom.
</constant>
<constant name="VALIGN_FILL" value="3" enum="VAlign">
Align the whole text by spreading the rows.
</constant>
<constant name="AUTOWRAP_OFF" value="0" enum="AutowrapMode">
Autowrap is disabled.
</constant>

View file

@ -159,8 +159,8 @@
</method>
</methods>
<members>
<member name="align" type="int" setter="set_align" getter="get_align" enum="LineEdit.Align" default="0">
Text alignment as defined in the [enum Align] enum.
<member name="alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0">
Text alignment as defined in the [enum HorizontalAlignment] enum.
</member>
<member name="caret_blink" type="bool" setter="set_caret_blink_enabled" getter="is_caret_blink_enabled" default="false">
If [code]true[/code], the caret (text cursor) blinks.
@ -292,18 +292,6 @@
</signal>
</signals>
<constants>
<constant name="ALIGN_LEFT" value="0" enum="Align">
Aligns the text on the left-hand side of the [LineEdit].
</constant>
<constant name="ALIGN_CENTER" value="1" enum="Align">
Centers the text in the middle of the [LineEdit].
</constant>
<constant name="ALIGN_RIGHT" value="2" enum="Align">
Aligns the text on the right-hand side of the [LineEdit].
</constant>
<constant name="ALIGN_FILL" value="3" enum="Align">
Expand row to fit the [LineEdit]'s width.
</constant>
<constant name="MENU_CUT" value="0" enum="MenuItems">
Cuts (copies and clears) the selected text.
</constant>

View file

@ -164,7 +164,7 @@
</methods>
<members>
<member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" overrides="BaseButton" enum="BaseButton.ActionMode" default="0" />
<member name="align" type="int" setter="set_text_align" getter="get_text_align" overrides="Button" enum="Button.TextAlign" default="0" />
<member name="alignment" type="int" setter="set_text_alignment" getter="get_text_alignment" overrides="Button" enum="HorizontalAlignment" default="0" />
<member name="selected" type="int" setter="_select_int" getter="get_selected" default="-1">
The index of the currently selected item, or [code]-1[/code] if no item is selected.
</member>

View file

@ -22,7 +22,7 @@
<argument index="1" name="width" type="int" default="0" />
<argument index="2" name="height" type="int" default="0" />
<argument index="3" name="color" type="Color" default="Color(1, 1, 1, 1)" />
<argument index="4" name="inline_align" type="int" enum="InlineAlign" default="5" />
<argument index="4" name="inline_align" type="int" enum="InlineAlignment" default="5" />
<description>
Adds an image's opening and closing tags to the tag stack, optionally providing a [code]width[/code] and [code]height[/code] to resize the image and a [code]color[/code] to tint the image.
If [code]width[/code] or [code]height[/code] is set to 0, the image size will be adjusted in order to keep the original aspect ratio.
@ -279,7 +279,7 @@
</method>
<method name="push_paragraph">
<return type="void" />
<argument index="0" name="align" type="int" enum="RichTextLabel.Align" />
<argument index="0" name="alignment" type="int" enum="HorizontalAlignment" />
<argument index="1" name="base_direction" type="int" enum="Control.TextDirection" default="0" />
<argument index="2" name="language" type="String" default="&quot;&quot;" />
<argument index="3" name="st_parser" type="int" enum="Control.StructuredTextParser" default="0" />
@ -296,7 +296,7 @@
<method name="push_table">
<return type="void" />
<argument index="0" name="columns" type="int" />
<argument index="1" name="inline_align" type="int" enum="InlineAlign" default="0" />
<argument index="1" name="inline_align" type="int" enum="InlineAlignment" default="0" />
<description>
Adds a [code][table=columns,inline_align][/code] tag to the tag stack.
</description>
@ -451,18 +451,6 @@
</signal>
</signals>
<constants>
<constant name="ALIGN_LEFT" value="0" enum="Align">
Makes text left aligned.
</constant>
<constant name="ALIGN_CENTER" value="1" enum="Align">
Makes text centered.
</constant>
<constant name="ALIGN_RIGHT" value="2" enum="Align">
Makes text right aligned.
</constant>
<constant name="ALIGN_FILL" value="3" enum="Align">
Makes text fill width.
</constant>
<constant name="LIST_NUMBERS" value="0" enum="ListType">
Each list item has a number marker.
</constant>

View file

@ -12,14 +12,14 @@
add_child(spin_box)
var line_edit = spin_box.get_line_edit()
line_edit.context_menu_enabled = false
spin_box.align = LineEdit.ALIGN_RIGHT
spin_box.horizontal_alignment = LineEdit.HORIZONTAL_ALIGNMENT_RIGHT
[/gdscript]
[csharp]
var spinBox = new SpinBox();
AddChild(spinBox);
var lineEdit = spinBox.GetLineEdit();
lineEdit.ContextMenuEnabled = false;
spinBox.Align = LineEdit.AlignEnum.Right;
spinBox.AlignHorizontal = LineEdit.HorizontalAlignEnum.Right;
[/csharp]
[/codeblocks]
The above code will create a [SpinBox], disable context menu on it and set the text alignment to right.
@ -44,8 +44,7 @@
</method>
</methods>
<members>
<member name="align" type="int" setter="set_align" getter="get_align" enum="LineEdit.Align" default="0">
Sets the text alignment of the [SpinBox].
<member name="alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0">
</member>
<member name="editable" type="bool" setter="set_editable" getter="is_editable" default="true">
If [code]true[/code], the [SpinBox] will be editable. Otherwise, it will be read only.

View file

@ -209,8 +209,7 @@
<member name="scrolling_enabled" type="bool" setter="set_scrolling_enabled" getter="get_scrolling_enabled" default="true">
if [code]true[/code], the mouse's scroll wheel can be used to navigate the scroll view.
</member>
<member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" enum="TabBar.TabAlign" default="1">
The alignment of all tabs. See [enum TabAlign] for details.
<member name="tab_alignment" type="int" setter="set_tab_alignment" getter="get_tab_alignment" enum="TabBar.AlignmentMode" default="1">
</member>
<member name="tab_close_display_policy" type="int" setter="set_tab_close_display_policy" getter="get_tab_close_display_policy" enum="TabBar.CloseButtonDisplayPolicy" default="0">
Sets when the close button will appear on the tabs. See [enum CloseButtonDisplayPolicy] for details.
@ -264,17 +263,13 @@
</signal>
</signals>
<constants>
<constant name="ALIGN_LEFT" value="0" enum="TabAlign">
Align the tabs to the left.
<constant name="ALIGNMENT_LEFT" value="0" enum="AlignmentMode">
</constant>
<constant name="ALIGN_CENTER" value="1" enum="TabAlign">
Align the tabs to the center.
<constant name="ALIGNMENT_CENTER" value="1" enum="AlignmentMode">
</constant>
<constant name="ALIGN_RIGHT" value="2" enum="TabAlign">
Align the tabs to the right.
<constant name="ALIGNMENT_RIGHT" value="2" enum="AlignmentMode">
</constant>
<constant name="ALIGN_MAX" value="3" enum="TabAlign">
Represents the size of the [enum TabAlign] enum.
<constant name="ALIGNMENT_MAX" value="3" enum="AlignmentMode">
</constant>
<constant name="CLOSE_BUTTON_SHOW_NEVER" value="0" enum="CloseButtonDisplayPolicy">
Never show the close buttons.

View file

@ -141,8 +141,7 @@
<member name="drag_to_rearrange_enabled" type="bool" setter="set_drag_to_rearrange_enabled" getter="get_drag_to_rearrange_enabled" default="false">
If [code]true[/code], tabs can be rearranged with mouse drag.
</member>
<member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" enum="TabContainer.TabAlign" default="1">
The alignment of all tabs in the tab container. See the [enum TabAlign] constants for details.
<member name="tab_alignment" type="int" setter="set_tab_alignment" getter="get_tab_alignment" enum="TabContainer.AlignmentMode" default="1">
</member>
<member name="tabs_visible" type="bool" setter="set_tabs_visible" getter="are_tabs_visible" default="true">
If [code]true[/code], tabs are visible. If [code]false[/code], tabs' content and titles are hidden.
@ -171,14 +170,11 @@
</signal>
</signals>
<constants>
<constant name="ALIGN_LEFT" value="0" enum="TabAlign">
Align the tabs to the left.
<constant name="ALIGNMENT_LEFT" value="0" enum="AlignmentMode">
</constant>
<constant name="ALIGN_CENTER" value="1" enum="TabAlign">
Align the tabs to the center.
<constant name="ALIGNMENT_CENTER" value="1" enum="AlignmentMode">
</constant>
<constant name="ALIGN_RIGHT" value="2" enum="TabAlign">
Align the tabs to the right.
<constant name="ALIGNMENT_RIGHT" value="2" enum="AlignmentMode">
</constant>
</constants>
<theme_items>

View file

@ -13,7 +13,7 @@
<return type="bool" />
<argument index="0" name="key" type="Variant" />
<argument index="1" name="size" type="Vector2" />
<argument index="2" name="inline_align" type="int" enum="InlineAlign" default="5" />
<argument index="2" name="inline_align" type="int" enum="InlineAlignment" default="5" />
<argument index="3" name="length" type="int" default="1" />
<description>
Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters.
@ -122,7 +122,7 @@
<return type="bool" />
<argument index="0" name="key" type="Variant" />
<argument index="1" name="size" type="Vector2" />
<argument index="2" name="inline_align" type="int" enum="InlineAlign" default="5" />
<argument index="2" name="inline_align" type="int" enum="InlineAlignment" default="5" />
<description>
Sets new size and alignment of embedded object.
</description>
@ -144,8 +144,7 @@
</method>
</methods>
<members>
<member name="align" type="int" setter="set_align" getter="get_align" enum="HAlign" default="0">
Text horizontal alignment.
<member name="alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0">
</member>
<member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0">
Text writing direction.

View file

@ -13,7 +13,7 @@
<return type="bool" />
<argument index="0" name="key" type="Variant" />
<argument index="1" name="size" type="Vector2" />
<argument index="2" name="inline_align" type="int" enum="InlineAlign" default="5" />
<argument index="2" name="inline_align" type="int" enum="InlineAlignment" default="5" />
<argument index="3" name="length" type="int" default="1" />
<description>
Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters.
@ -240,7 +240,7 @@
<return type="bool" />
<argument index="0" name="key" type="Variant" />
<argument index="1" name="size" type="Vector2" />
<argument index="2" name="inline_align" type="int" enum="InlineAlign" default="5" />
<argument index="2" name="inline_align" type="int" enum="InlineAlignment" default="5" />
<description>
Sets new size and alignment of embedded object.
</description>
@ -275,7 +275,7 @@
</method>
</methods>
<members>
<member name="align" type="int" setter="set_align" getter="get_align" enum="HAlign" default="0">
<member name="alignment" type="int" setter="set_alignment" getter="get_alignment" enum="HorizontalAlignment" default="0">
Paragraph horizontal alignment.
</member>
<member name="custom_punctuation" type="String" setter="set_custom_punctuation" getter="get_custom_punctuation" default="&quot;&quot;">

View file

@ -886,7 +886,7 @@
<argument index="0" name="shaped" type="RID" />
<argument index="1" name="key" type="Variant" />
<argument index="2" name="size" type="Vector2" />
<argument index="3" name="inline_align" type="int" enum="InlineAlign" default="5" />
<argument index="3" name="inline_align" type="int" enum="InlineAlignment" default="5" />
<argument index="4" name="length" type="int" default="1" />
<description>
Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters.
@ -1213,7 +1213,7 @@
<argument index="0" name="shaped" type="RID" />
<argument index="1" name="key" type="Variant" />
<argument index="2" name="size" type="Vector2" />
<argument index="3" name="inline_align" type="int" enum="InlineAlign" default="5" />
<argument index="3" name="inline_align" type="int" enum="InlineAlignment" default="5" />
<description>
Sets new size and alignment of embedded object.
</description>

View file

@ -893,7 +893,7 @@
<argument index="0" name="shaped" type="RID" />
<argument index="1" name="key" type="Variant" />
<argument index="2" name="size" type="Vector2" />
<argument index="3" name="inline_align" type="int" enum="InlineAlign" />
<argument index="3" name="inline_align" type="int" enum="InlineAlignment" />
<argument index="4" name="length" type="int" />
<description>
Adds inline object to the text buffer, [code]key[/code] must be unique. In the text, object is represented as [code]length[/code] object replacement characters.
@ -1222,7 +1222,7 @@
<argument index="0" name="shaped" type="RID" />
<argument index="1" name="key" type="Variant" />
<argument index="2" name="size" type="Vector2" />
<argument index="3" name="inline_align" type="int" enum="InlineAlign" />
<argument index="3" name="inline_align" type="int" enum="InlineAlignment" />
<description>
Sets new size and alignment of embedded object.
</description>

View file

@ -293,8 +293,8 @@
Returns the given column's text.
</description>
</method>
<method name="get_text_align" qualifiers="const">
<return type="int" enum="TreeItem.TextAlign" />
<method name="get_text_alignment" qualifiers="const">
<return type="int" enum="HorizontalAlignment" />
<argument index="0" name="column" type="int" />
<description>
Returns the given column's text alignment.
@ -623,12 +623,12 @@
Sets the given column's text value.
</description>
</method>
<method name="set_text_align">
<method name="set_text_alignment">
<return type="void" />
<argument index="0" name="column" type="int" />
<argument index="1" name="text_align" type="int" enum="TreeItem.TextAlign" />
<argument index="1" name="text_alignment" type="int" enum="HorizontalAlignment" />
<description>
Sets the given column's text alignment. See [enum TextAlign] for possible values.
Sets the given column's text alignment. See [enum HorizontalAlignment] for possible values.
</description>
</method>
<method name="set_text_direction">
@ -679,14 +679,5 @@
</constant>
<constant name="CELL_MODE_CUSTOM" value="4" enum="TreeCellMode">
</constant>
<constant name="ALIGN_LEFT" value="0" enum="TextAlign">
Align text to the left. See [code]set_text_align()[/code].
</constant>
<constant name="ALIGN_CENTER" value="1" enum="TextAlign">
Center text. See [code]set_text_align()[/code].
</constant>
<constant name="ALIGN_RIGHT" value="2" enum="TextAlign">
Align text to the right. See [code]set_text_align()[/code].
</constant>
</constants>
</class>

View file

@ -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);

View file

@ -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);
}

View file

@ -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);

View file

@ -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) {

View file

@ -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);

View file

@ -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);

View file

@ -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

View file

@ -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);

View file

@ -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;

View file

@ -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) {

View file

@ -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));

View file

@ -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);

View file

@ -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);
}
}

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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") {

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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() {

View file

@ -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();

View file

@ -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));

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);
}

View file

@ -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));
}
}
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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) {

View file

@ -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);

View file

@ -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")));

View file

@ -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));
}
}

View file

@ -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);
}
}

View file

@ -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);

View file

@ -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);

View file

@ -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));

View file

@ -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);

View file

@ -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));

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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));
}
}
}

View file

@ -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);

View file

@ -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();

View file

@ -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.

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -110,7 +110,7 @@ void GDNativeLibraryEditor::_update_tree() {
TreeItem *new_arch = tree->create_item(platform);
new_arch->set_text(0, TTR("Double click to create a new entry"));
new_arch->set_text_align(0, TreeItem::ALIGN_CENTER);
new_arch->set_text_alignment(0, HORIZONTAL_ALIGNMENT_CENTER);
new_arch->set_custom_color(0, get_theme_color(SNAME("accent_color"), SNAME("Editor")));
new_arch->set_expand_right(0, true);
new_arch->set_metadata(1, E->key());
@ -335,7 +335,7 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() {
hbox->add_child(label);
filter = memnew(MenuButton);
filter->set_h_size_flags(SIZE_EXPAND_FILL);
filter->set_text_align(filter->ALIGN_LEFT);
filter->set_text_alignment(HORIZONTAL_ALIGNMENT_LEFT);
hbox->add_child(filter);
PopupMenu *filter_list = filter->get_popup();
filter_list->set_hide_on_checkable_item_selection(false);

View file

@ -1163,7 +1163,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
spatial_editor_hb = memnew(HBoxContainer);
spatial_editor_hb->set_h_size_flags(SIZE_EXPAND_FILL);
spatial_editor_hb->set_alignment(BoxContainer::ALIGN_END);
spatial_editor_hb->set_alignment(BoxContainer::ALIGNMENT_END);
Node3DEditor::get_singleton()->add_control_to_menu_panel(spatial_editor_hb);
spin_box_label = memnew(Label);
@ -1280,8 +1280,8 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
info_message = memnew(Label);
info_message->set_text(TTR("Give a MeshLibrary resource to this GridMap to use its meshes."));
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);

View file

@ -3144,7 +3144,7 @@ bool TextServerAdvanced::shaped_text_add_string(RID p_shaped, const String &p_te
return true;
}
bool TextServerAdvanced::shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align, int p_length) {
bool TextServerAdvanced::shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align, int p_length) {
_THREAD_SAFE_METHOD_
ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped);
ERR_FAIL_COND_V(!sd, false);
@ -3174,7 +3174,7 @@ bool TextServerAdvanced::shaped_text_add_object(RID p_shaped, Variant p_key, con
return true;
}
bool TextServerAdvanced::shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align) {
bool TextServerAdvanced::shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align) {
ShapedTextData *sd = shaped_owner.get_or_null(p_shaped);
ERR_FAIL_COND_V(!sd, false);
@ -3242,56 +3242,56 @@ bool TextServerAdvanced::shaped_text_resize_object(RID p_shaped, Variant p_key,
for (KeyValue<Variant, ShapedTextData::EmbeddedObject> &E : sd->objects) {
if ((E.value.pos >= sd->start) && (E.value.pos < sd->end)) {
if (sd->orientation == ORIENTATION_HORIZONTAL) {
switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) {
case INLINE_ALIGN_TO_TOP: {
switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) {
case INLINE_ALIGNMENT_TO_TOP: {
E.value.rect.position.y = -sd->ascent;
} break;
case INLINE_ALIGN_TO_CENTER: {
case INLINE_ALIGNMENT_TO_CENTER: {
E.value.rect.position.y = (-sd->ascent + sd->descent) / 2;
} break;
case INLINE_ALIGN_TO_BASELINE: {
case INLINE_ALIGNMENT_TO_BASELINE: {
E.value.rect.position.y = 0;
} break;
case INLINE_ALIGN_TO_BOTTOM: {
case INLINE_ALIGNMENT_TO_BOTTOM: {
E.value.rect.position.y = sd->descent;
} break;
}
switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) {
case INLINE_ALIGN_BOTTOM_TO: {
switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) {
case INLINE_ALIGNMENT_BOTTOM_TO: {
E.value.rect.position.y -= E.value.rect.size.y;
} break;
case INLINE_ALIGN_CENTER_TO: {
case INLINE_ALIGNMENT_CENTER_TO: {
E.value.rect.position.y -= E.value.rect.size.y / 2;
} break;
case INLINE_ALIGN_TOP_TO: {
case INLINE_ALIGNMENT_TOP_TO: {
// NOP
} break;
}
full_ascent = MAX(full_ascent, -E.value.rect.position.y);
full_descent = MAX(full_descent, E.value.rect.position.y + E.value.rect.size.y);
} else {
switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) {
case INLINE_ALIGN_TO_TOP: {
switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) {
case INLINE_ALIGNMENT_TO_TOP: {
E.value.rect.position.x = -sd->ascent;
} break;
case INLINE_ALIGN_TO_CENTER: {
case INLINE_ALIGNMENT_TO_CENTER: {
E.value.rect.position.x = (-sd->ascent + sd->descent) / 2;
} break;
case INLINE_ALIGN_TO_BASELINE: {
case INLINE_ALIGNMENT_TO_BASELINE: {
E.value.rect.position.x = 0;
} break;
case INLINE_ALIGN_TO_BOTTOM: {
case INLINE_ALIGNMENT_TO_BOTTOM: {
E.value.rect.position.x = sd->descent;
} break;
}
switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) {
case INLINE_ALIGN_BOTTOM_TO: {
switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) {
case INLINE_ALIGNMENT_BOTTOM_TO: {
E.value.rect.position.x -= E.value.rect.size.x;
} break;
case INLINE_ALIGN_CENTER_TO: {
case INLINE_ALIGNMENT_CENTER_TO: {
E.value.rect.position.x -= E.value.rect.size.x / 2;
} break;
case INLINE_ALIGN_TOP_TO: {
case INLINE_ALIGNMENT_TOP_TO: {
// NOP
} break;
}
@ -3433,56 +3433,56 @@ RID TextServerAdvanced::shaped_text_substr(RID p_shaped, int p_start, int p_leng
for (KeyValue<Variant, ShapedTextData::EmbeddedObject> &E : new_sd->objects) {
if ((E.value.pos >= new_sd->start) && (E.value.pos < new_sd->end)) {
if (sd->orientation == ORIENTATION_HORIZONTAL) {
switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) {
case INLINE_ALIGN_TO_TOP: {
switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) {
case INLINE_ALIGNMENT_TO_TOP: {
E.value.rect.position.y = -new_sd->ascent;
} break;
case INLINE_ALIGN_TO_CENTER: {
case INLINE_ALIGNMENT_TO_CENTER: {
E.value.rect.position.y = (-new_sd->ascent + new_sd->descent) / 2;
} break;
case INLINE_ALIGN_TO_BASELINE: {
case INLINE_ALIGNMENT_TO_BASELINE: {
E.value.rect.position.y = 0;
} break;
case INLINE_ALIGN_TO_BOTTOM: {
case INLINE_ALIGNMENT_TO_BOTTOM: {
E.value.rect.position.y = new_sd->descent;
} break;
}
switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) {
case INLINE_ALIGN_BOTTOM_TO: {
switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) {
case INLINE_ALIGNMENT_BOTTOM_TO: {
E.value.rect.position.y -= E.value.rect.size.y;
} break;
case INLINE_ALIGN_CENTER_TO: {
case INLINE_ALIGNMENT_CENTER_TO: {
E.value.rect.position.y -= E.value.rect.size.y / 2;
} break;
case INLINE_ALIGN_TOP_TO: {
case INLINE_ALIGNMENT_TOP_TO: {
// NOP
} break;
}
full_ascent = MAX(full_ascent, -E.value.rect.position.y);
full_descent = MAX(full_descent, E.value.rect.position.y + E.value.rect.size.y);
} else {
switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) {
case INLINE_ALIGN_TO_TOP: {
switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) {
case INLINE_ALIGNMENT_TO_TOP: {
E.value.rect.position.x = -new_sd->ascent;
} break;
case INLINE_ALIGN_TO_CENTER: {
case INLINE_ALIGNMENT_TO_CENTER: {
E.value.rect.position.x = (-new_sd->ascent + new_sd->descent) / 2;
} break;
case INLINE_ALIGN_TO_BASELINE: {
case INLINE_ALIGNMENT_TO_BASELINE: {
E.value.rect.position.x = 0;
} break;
case INLINE_ALIGN_TO_BOTTOM: {
case INLINE_ALIGNMENT_TO_BOTTOM: {
E.value.rect.position.x = new_sd->descent;
} break;
}
switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) {
case INLINE_ALIGN_BOTTOM_TO: {
switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) {
case INLINE_ALIGNMENT_BOTTOM_TO: {
E.value.rect.position.x -= E.value.rect.size.x;
} break;
case INLINE_ALIGN_CENTER_TO: {
case INLINE_ALIGNMENT_CENTER_TO: {
E.value.rect.position.x -= E.value.rect.size.x / 2;
} break;
case INLINE_ALIGN_TOP_TO: {
case INLINE_ALIGNMENT_TOP_TO: {
// NOP
} break;
}
@ -4579,56 +4579,56 @@ bool TextServerAdvanced::shaped_text_shape(RID p_shaped) {
float full_descent = sd->descent;
for (KeyValue<Variant, ShapedTextData::EmbeddedObject> &E : sd->objects) {
if (sd->orientation == ORIENTATION_HORIZONTAL) {
switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) {
case INLINE_ALIGN_TO_TOP: {
switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) {
case INLINE_ALIGNMENT_TO_TOP: {
E.value.rect.position.y = -sd->ascent;
} break;
case INLINE_ALIGN_TO_CENTER: {
case INLINE_ALIGNMENT_TO_CENTER: {
E.value.rect.position.y = (-sd->ascent + sd->descent) / 2;
} break;
case INLINE_ALIGN_TO_BASELINE: {
case INLINE_ALIGNMENT_TO_BASELINE: {
E.value.rect.position.y = 0;
} break;
case INLINE_ALIGN_TO_BOTTOM: {
case INLINE_ALIGNMENT_TO_BOTTOM: {
E.value.rect.position.y = sd->descent;
} break;
}
switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) {
case INLINE_ALIGN_BOTTOM_TO: {
switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) {
case INLINE_ALIGNMENT_BOTTOM_TO: {
E.value.rect.position.y -= E.value.rect.size.y;
} break;
case INLINE_ALIGN_CENTER_TO: {
case INLINE_ALIGNMENT_CENTER_TO: {
E.value.rect.position.y -= E.value.rect.size.y / 2;
} break;
case INLINE_ALIGN_TOP_TO: {
case INLINE_ALIGNMENT_TOP_TO: {
// NOP
} break;
}
full_ascent = MAX(full_ascent, -E.value.rect.position.y);
full_descent = MAX(full_descent, E.value.rect.position.y + E.value.rect.size.y);
} else {
switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) {
case INLINE_ALIGN_TO_TOP: {
switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) {
case INLINE_ALIGNMENT_TO_TOP: {
E.value.rect.position.x = -sd->ascent;
} break;
case INLINE_ALIGN_TO_CENTER: {
case INLINE_ALIGNMENT_TO_CENTER: {
E.value.rect.position.x = (-sd->ascent + sd->descent) / 2;
} break;
case INLINE_ALIGN_TO_BASELINE: {
case INLINE_ALIGNMENT_TO_BASELINE: {
E.value.rect.position.x = 0;
} break;
case INLINE_ALIGN_TO_BOTTOM: {
case INLINE_ALIGNMENT_TO_BOTTOM: {
E.value.rect.position.x = sd->descent;
} break;
}
switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) {
case INLINE_ALIGN_BOTTOM_TO: {
switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) {
case INLINE_ALIGNMENT_BOTTOM_TO: {
E.value.rect.position.x -= E.value.rect.size.x;
} break;
case INLINE_ALIGN_CENTER_TO: {
case INLINE_ALIGNMENT_CENTER_TO: {
E.value.rect.position.x -= E.value.rect.size.x / 2;
} break;
case INLINE_ALIGN_TOP_TO: {
case INLINE_ALIGNMENT_TOP_TO: {
// NOP
} break;
}

View file

@ -476,8 +476,8 @@ public:
virtual bool shaped_text_get_preserve_control(RID p_shaped) const override;
virtual bool shaped_text_add_string(RID p_shaped, const String &p_text, const Vector<RID> &p_fonts, int p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "") override;
virtual bool shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align = INLINE_ALIGN_CENTER, int p_length = 1) override;
virtual bool shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align = INLINE_ALIGN_CENTER) override;
virtual bool shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int p_length = 1) override;
virtual bool shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER) override;
virtual RID shaped_text_substr(RID p_shaped, int p_start, int p_length) const override;
virtual RID shaped_text_get_parent(RID p_shaped) const override;

View file

@ -2247,7 +2247,7 @@ bool TextServerFallback::shaped_text_add_string(RID p_shaped, const String &p_te
return true;
}
bool TextServerFallback::shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align, int p_length) {
bool TextServerFallback::shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align, int p_length) {
ShapedTextData *sd = shaped_owner.get_or_null(p_shaped);
ERR_FAIL_COND_V(!sd, false);
@ -2278,7 +2278,7 @@ bool TextServerFallback::shaped_text_add_object(RID p_shaped, Variant p_key, con
return true;
}
bool TextServerFallback::shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align) {
bool TextServerFallback::shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align) {
ShapedTextData *sd = shaped_owner.get_or_null(p_shaped);
ERR_FAIL_COND_V(!sd, false);
@ -2346,56 +2346,56 @@ bool TextServerFallback::shaped_text_resize_object(RID p_shaped, Variant p_key,
for (KeyValue<Variant, ShapedTextData::EmbeddedObject> &E : sd->objects) {
if ((E.value.pos >= sd->start) && (E.value.pos < sd->end)) {
if (sd->orientation == ORIENTATION_HORIZONTAL) {
switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) {
case INLINE_ALIGN_TO_TOP: {
switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) {
case INLINE_ALIGNMENT_TO_TOP: {
E.value.rect.position.y = -sd->ascent;
} break;
case INLINE_ALIGN_TO_CENTER: {
case INLINE_ALIGNMENT_TO_CENTER: {
E.value.rect.position.y = (-sd->ascent + sd->descent) / 2;
} break;
case INLINE_ALIGN_TO_BASELINE: {
case INLINE_ALIGNMENT_TO_BASELINE: {
E.value.rect.position.y = 0;
} break;
case INLINE_ALIGN_TO_BOTTOM: {
case INLINE_ALIGNMENT_TO_BOTTOM: {
E.value.rect.position.y = sd->descent;
} break;
}
switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) {
case INLINE_ALIGN_BOTTOM_TO: {
switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) {
case INLINE_ALIGNMENT_BOTTOM_TO: {
E.value.rect.position.y -= E.value.rect.size.y;
} break;
case INLINE_ALIGN_CENTER_TO: {
case INLINE_ALIGNMENT_CENTER_TO: {
E.value.rect.position.y -= E.value.rect.size.y / 2;
} break;
case INLINE_ALIGN_TOP_TO: {
case INLINE_ALIGNMENT_TOP_TO: {
// NOP
} break;
}
full_ascent = MAX(full_ascent, -E.value.rect.position.y);
full_descent = MAX(full_descent, E.value.rect.position.y + E.value.rect.size.y);
} else {
switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) {
case INLINE_ALIGN_TO_TOP: {
switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) {
case INLINE_ALIGNMENT_TO_TOP: {
E.value.rect.position.x = -sd->ascent;
} break;
case INLINE_ALIGN_TO_CENTER: {
case INLINE_ALIGNMENT_TO_CENTER: {
E.value.rect.position.x = (-sd->ascent + sd->descent) / 2;
} break;
case INLINE_ALIGN_TO_BASELINE: {
case INLINE_ALIGNMENT_TO_BASELINE: {
E.value.rect.position.x = 0;
} break;
case INLINE_ALIGN_TO_BOTTOM: {
case INLINE_ALIGNMENT_TO_BOTTOM: {
E.value.rect.position.x = sd->descent;
} break;
}
switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) {
case INLINE_ALIGN_BOTTOM_TO: {
switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) {
case INLINE_ALIGNMENT_BOTTOM_TO: {
E.value.rect.position.x -= E.value.rect.size.x;
} break;
case INLINE_ALIGN_CENTER_TO: {
case INLINE_ALIGNMENT_CENTER_TO: {
E.value.rect.position.x -= E.value.rect.size.x / 2;
} break;
case INLINE_ALIGN_TOP_TO: {
case INLINE_ALIGNMENT_TOP_TO: {
// NOP
} break;
}
@ -2498,56 +2498,56 @@ RID TextServerFallback::shaped_text_substr(RID p_shaped, int p_start, int p_leng
for (KeyValue<Variant, ShapedTextData::EmbeddedObject> &E : new_sd->objects) {
if ((E.value.pos >= new_sd->start) && (E.value.pos < new_sd->end)) {
if (sd->orientation == ORIENTATION_HORIZONTAL) {
switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) {
case INLINE_ALIGN_TO_TOP: {
switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) {
case INLINE_ALIGNMENT_TO_TOP: {
E.value.rect.position.y = -new_sd->ascent;
} break;
case INLINE_ALIGN_TO_CENTER: {
case INLINE_ALIGNMENT_TO_CENTER: {
E.value.rect.position.y = (-new_sd->ascent + new_sd->descent) / 2;
} break;
case INLINE_ALIGN_TO_BASELINE: {
case INLINE_ALIGNMENT_TO_BASELINE: {
E.value.rect.position.y = 0;
} break;
case INLINE_ALIGN_TO_BOTTOM: {
case INLINE_ALIGNMENT_TO_BOTTOM: {
E.value.rect.position.y = new_sd->descent;
} break;
}
switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) {
case INLINE_ALIGN_BOTTOM_TO: {
switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) {
case INLINE_ALIGNMENT_BOTTOM_TO: {
E.value.rect.position.y -= E.value.rect.size.y;
} break;
case INLINE_ALIGN_CENTER_TO: {
case INLINE_ALIGNMENT_CENTER_TO: {
E.value.rect.position.y -= E.value.rect.size.y / 2;
} break;
case INLINE_ALIGN_TOP_TO: {
case INLINE_ALIGNMENT_TOP_TO: {
// NOP
} break;
}
full_ascent = MAX(full_ascent, -E.value.rect.position.y);
full_descent = MAX(full_descent, E.value.rect.position.y + E.value.rect.size.y);
} else {
switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) {
case INLINE_ALIGN_TO_TOP: {
switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) {
case INLINE_ALIGNMENT_TO_TOP: {
E.value.rect.position.x = -new_sd->ascent;
} break;
case INLINE_ALIGN_TO_CENTER: {
case INLINE_ALIGNMENT_TO_CENTER: {
E.value.rect.position.x = (-new_sd->ascent + new_sd->descent) / 2;
} break;
case INLINE_ALIGN_TO_BASELINE: {
case INLINE_ALIGNMENT_TO_BASELINE: {
E.value.rect.position.x = 0;
} break;
case INLINE_ALIGN_TO_BOTTOM: {
case INLINE_ALIGNMENT_TO_BOTTOM: {
E.value.rect.position.x = new_sd->descent;
} break;
}
switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) {
case INLINE_ALIGN_BOTTOM_TO: {
switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) {
case INLINE_ALIGNMENT_BOTTOM_TO: {
E.value.rect.position.x -= E.value.rect.size.x;
} break;
case INLINE_ALIGN_CENTER_TO: {
case INLINE_ALIGNMENT_CENTER_TO: {
E.value.rect.position.x -= E.value.rect.size.x / 2;
} break;
case INLINE_ALIGN_TOP_TO: {
case INLINE_ALIGNMENT_TOP_TO: {
// NOP
} break;
}
@ -3052,56 +3052,56 @@ bool TextServerFallback::shaped_text_shape(RID p_shaped) {
float full_descent = sd->descent;
for (KeyValue<Variant, ShapedTextData::EmbeddedObject> &E : sd->objects) {
if (sd->orientation == ORIENTATION_HORIZONTAL) {
switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) {
case INLINE_ALIGN_TO_TOP: {
switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) {
case INLINE_ALIGNMENT_TO_TOP: {
E.value.rect.position.y = -sd->ascent;
} break;
case INLINE_ALIGN_TO_CENTER: {
case INLINE_ALIGNMENT_TO_CENTER: {
E.value.rect.position.y = (-sd->ascent + sd->descent) / 2;
} break;
case INLINE_ALIGN_TO_BASELINE: {
case INLINE_ALIGNMENT_TO_BASELINE: {
E.value.rect.position.y = 0;
} break;
case INLINE_ALIGN_TO_BOTTOM: {
case INLINE_ALIGNMENT_TO_BOTTOM: {
E.value.rect.position.y = sd->descent;
} break;
}
switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) {
case INLINE_ALIGN_BOTTOM_TO: {
switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) {
case INLINE_ALIGNMENT_BOTTOM_TO: {
E.value.rect.position.y -= E.value.rect.size.y;
} break;
case INLINE_ALIGN_CENTER_TO: {
case INLINE_ALIGNMENT_CENTER_TO: {
E.value.rect.position.y -= E.value.rect.size.y / 2;
} break;
case INLINE_ALIGN_TOP_TO: {
case INLINE_ALIGNMENT_TOP_TO: {
// NOP
} break;
}
full_ascent = MAX(full_ascent, -E.value.rect.position.y);
full_descent = MAX(full_descent, E.value.rect.position.y + E.value.rect.size.y);
} else {
switch (E.value.inline_align & INLINE_ALIGN_TEXT_MASK) {
case INLINE_ALIGN_TO_TOP: {
switch (E.value.inline_align & INLINE_ALIGNMENT_TEXT_MASK) {
case INLINE_ALIGNMENT_TO_TOP: {
E.value.rect.position.x = -sd->ascent;
} break;
case INLINE_ALIGN_TO_CENTER: {
case INLINE_ALIGNMENT_TO_CENTER: {
E.value.rect.position.x = (-sd->ascent + sd->descent) / 2;
} break;
case INLINE_ALIGN_TO_BASELINE: {
case INLINE_ALIGNMENT_TO_BASELINE: {
E.value.rect.position.x = 0;
} break;
case INLINE_ALIGN_TO_BOTTOM: {
case INLINE_ALIGNMENT_TO_BOTTOM: {
E.value.rect.position.x = sd->descent;
} break;
}
switch (E.value.inline_align & INLINE_ALIGN_IMAGE_MASK) {
case INLINE_ALIGN_BOTTOM_TO: {
switch (E.value.inline_align & INLINE_ALIGNMENT_IMAGE_MASK) {
case INLINE_ALIGNMENT_BOTTOM_TO: {
E.value.rect.position.x -= E.value.rect.size.x;
} break;
case INLINE_ALIGN_CENTER_TO: {
case INLINE_ALIGNMENT_CENTER_TO: {
E.value.rect.position.x -= E.value.rect.size.x / 2;
} break;
case INLINE_ALIGN_TOP_TO: {
case INLINE_ALIGNMENT_TOP_TO: {
// NOP
} break;
}

View file

@ -387,8 +387,8 @@ public:
virtual bool shaped_text_get_preserve_control(RID p_shaped) const override;
virtual bool shaped_text_add_string(RID p_shaped, const String &p_text, const Vector<RID> &p_fonts, int p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "") override;
virtual bool shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align = INLINE_ALIGN_CENTER, int p_length = 1) override;
virtual bool shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align = INLINE_ALIGN_CENTER) override;
virtual bool shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int p_length = 1) override;
virtual bool shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER) override;
virtual RID shaped_text_substr(RID p_shaped, int p_start, int p_length) const override;
virtual RID shaped_text_get_parent(RID p_shaped) const override;

View file

@ -779,7 +779,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
for (int i = 0; i < node->get_output_sequence_port_count(); i++) {
Label *text2 = memnew(Label);
text2->set_text(node->get_output_sequence_port_text(i));
text2->set_align(Label::ALIGN_RIGHT);
text2->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
gnode->add_child(text2);
gnode->set_slot(slot_idx, false, 0, Color(), true, TYPE_SEQUENCE, mono_color, seq_port, seq_port);
slot_idx++;
@ -900,7 +900,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
if (i < mixed_seq_ports) {
Label *text2 = memnew(Label);
text2->set_text(node->get_output_sequence_port_text(i));
text2->set_align(Label::ALIGN_RIGHT);
text2->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
hbc->add_child(text2);
}
@ -4476,8 +4476,8 @@ VisualScriptEditor::VisualScriptEditor() {
select_func_text = memnew(Label);
select_func_text->set_text(TTR("Select or create a function to edit its graph."));
select_func_text->set_align(Label::ALIGN_CENTER);
select_func_text->set_valign(Label::VALIGN_CENTER);
select_func_text->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
select_func_text->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
select_func_text->set_h_size_flags(SIZE_EXPAND_FILL);
add_child(select_func_text);
@ -4485,8 +4485,8 @@ VisualScriptEditor::VisualScriptEditor() {
hint_text->set_anchor_and_offset(SIDE_TOP, ANCHOR_END, -100);
hint_text->set_anchor_and_offset(SIDE_BOTTOM, ANCHOR_END, 0);
hint_text->set_anchor_and_offset(SIDE_RIGHT, ANCHOR_END, 0);
hint_text->set_align(Label::ALIGN_CENTER);
hint_text->set_valign(Label::VALIGN_CENTER);
hint_text->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
hint_text->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
graph->add_child(hint_text);
hint_text_timer = memnew(Timer);

View file

@ -60,12 +60,12 @@ void AspectRatioContainer::set_stretch_mode(StretchMode p_mode) {
queue_sort();
}
void AspectRatioContainer::set_alignment_horizontal(AlignMode p_alignment_horizontal) {
void AspectRatioContainer::set_alignment_horizontal(AlignmentMode p_alignment_horizontal) {
alignment_horizontal = p_alignment_horizontal;
queue_sort();
}
void AspectRatioContainer::set_alignment_vertical(AlignMode p_alignment_vertical) {
void AspectRatioContainer::set_alignment_vertical(AlignmentMode p_alignment_vertical) {
alignment_vertical = p_alignment_vertical;
queue_sort();
}
@ -107,25 +107,25 @@ void AspectRatioContainer::_notification(int p_what) {
float align_x = 0.5;
switch (alignment_horizontal) {
case ALIGN_BEGIN: {
case ALIGNMENT_BEGIN: {
align_x = 0.0;
} break;
case ALIGN_CENTER: {
case ALIGNMENT_CENTER: {
align_x = 0.5;
} break;
case ALIGN_END: {
case ALIGNMENT_END: {
align_x = 1.0;
} break;
}
float align_y = 0.5;
switch (alignment_vertical) {
case ALIGN_BEGIN: {
case ALIGNMENT_BEGIN: {
align_y = 0.0;
} break;
case ALIGN_CENTER: {
case ALIGNMENT_CENTER: {
align_y = 0.5;
} break;
case ALIGN_END: {
case ALIGNMENT_END: {
align_y = 1.0;
} break;
}
@ -166,7 +166,7 @@ void AspectRatioContainer::_bind_methods() {
BIND_ENUM_CONSTANT(STRETCH_FIT);
BIND_ENUM_CONSTANT(STRETCH_COVER);
BIND_ENUM_CONSTANT(ALIGN_BEGIN);
BIND_ENUM_CONSTANT(ALIGN_CENTER);
BIND_ENUM_CONSTANT(ALIGN_END);
BIND_ENUM_CONSTANT(ALIGNMENT_BEGIN);
BIND_ENUM_CONSTANT(ALIGNMENT_CENTER);
BIND_ENUM_CONSTANT(ALIGNMENT_END);
}

View file

@ -48,17 +48,17 @@ public:
STRETCH_FIT,
STRETCH_COVER,
};
enum AlignMode {
ALIGN_BEGIN,
ALIGN_CENTER,
ALIGN_END,
enum AlignmentMode {
ALIGNMENT_BEGIN,
ALIGNMENT_CENTER,
ALIGNMENT_END,
};
private:
float ratio = 1.0;
StretchMode stretch_mode = STRETCH_FIT;
AlignMode alignment_horizontal = ALIGN_CENTER;
AlignMode alignment_vertical = ALIGN_CENTER;
AlignmentMode alignment_horizontal = ALIGNMENT_CENTER;
AlignmentMode alignment_vertical = ALIGNMENT_CENTER;
public:
void set_ratio(float p_ratio);
@ -67,14 +67,14 @@ public:
void set_stretch_mode(StretchMode p_mode);
StretchMode get_stretch_mode() const { return stretch_mode; }
void set_alignment_horizontal(AlignMode p_alignment_horizontal);
AlignMode get_alignment_horizontal() const { return alignment_horizontal; }
void set_alignment_horizontal(AlignmentMode p_alignment_horizontal);
AlignmentMode get_alignment_horizontal() const { return alignment_horizontal; }
void set_alignment_vertical(AlignMode p_alignment_vertical);
AlignMode get_alignment_vertical() const { return alignment_vertical; }
void set_alignment_vertical(AlignmentMode p_alignment_vertical);
AlignmentMode get_alignment_vertical() const { return alignment_vertical; }
};
VARIANT_ENUM_CAST(AspectRatioContainer::StretchMode);
VARIANT_ENUM_CAST(AspectRatioContainer::AlignMode);
VARIANT_ENUM_CAST(AspectRatioContainer::AlignmentMode);
#endif // ASPECT_RATIO_CONTAINER_H

View file

@ -154,29 +154,29 @@ void BoxContainer::_resort() {
int ofs = 0;
if (!has_stretched) {
if (!vertical) {
switch (align) {
case ALIGN_BEGIN:
switch (alignment) {
case ALIGNMENT_BEGIN:
if (rtl) {
ofs = stretch_diff;
}
break;
case ALIGN_CENTER:
case ALIGNMENT_CENTER:
ofs = stretch_diff / 2;
break;
case ALIGN_END:
case ALIGNMENT_END:
if (!rtl) {
ofs = stretch_diff;
}
break;
}
} else {
switch (align) {
case ALIGN_BEGIN:
switch (alignment) {
case ALIGNMENT_BEGIN:
break;
case ALIGN_CENTER:
case ALIGNMENT_CENTER:
ofs = stretch_diff / 2;
break;
case ALIGN_END:
case ALIGNMENT_END:
ofs = stretch_diff;
break;
}
@ -304,13 +304,13 @@ void BoxContainer::_notification(int p_what) {
}
}
void BoxContainer::set_alignment(AlignMode p_align) {
align = p_align;
void BoxContainer::set_alignment(AlignmentMode p_alignment) {
alignment = p_alignment;
_resort();
}
BoxContainer::AlignMode BoxContainer::get_alignment() const {
return align;
BoxContainer::AlignmentMode BoxContainer::get_alignment() const {
return alignment;
}
Control *BoxContainer::add_spacer(bool p_begin) {
@ -340,9 +340,9 @@ void BoxContainer::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_alignment"), &BoxContainer::get_alignment);
ClassDB::bind_method(D_METHOD("set_alignment", "alignment"), &BoxContainer::set_alignment);
BIND_ENUM_CONSTANT(ALIGN_BEGIN);
BIND_ENUM_CONSTANT(ALIGN_CENTER);
BIND_ENUM_CONSTANT(ALIGN_END);
BIND_ENUM_CONSTANT(ALIGNMENT_BEGIN);
BIND_ENUM_CONSTANT(ALIGNMENT_CENTER);
BIND_ENUM_CONSTANT(ALIGNMENT_END);
ADD_PROPERTY(PropertyInfo(Variant::INT, "alignment", PROPERTY_HINT_ENUM, "Begin,Center,End"), "set_alignment", "get_alignment");
}

View file

@ -37,15 +37,15 @@ class BoxContainer : public Container {
GDCLASS(BoxContainer, Container);
public:
enum AlignMode {
ALIGN_BEGIN,
ALIGN_CENTER,
ALIGN_END
enum AlignmentMode {
ALIGNMENT_BEGIN,
ALIGNMENT_CENTER,
ALIGNMENT_END
};
private:
bool vertical = false;
AlignMode align = ALIGN_BEGIN;
AlignmentMode alignment = ALIGNMENT_BEGIN;
void _resort();
@ -57,8 +57,8 @@ protected:
public:
Control *add_spacer(bool p_begin = false);
void set_alignment(AlignMode p_align);
AlignMode get_alignment() const;
void set_alignment(AlignmentMode p_alignment);
AlignmentMode get_alignment() const;
virtual Size2 get_minimum_size() const override;
@ -84,6 +84,6 @@ public:
BoxContainer(true) {}
};
VARIANT_ENUM_CAST(BoxContainer::AlignMode);
VARIANT_ENUM_CAST(BoxContainer::AlignmentMode);
#endif // BOX_CONTAINER_H

View file

@ -50,7 +50,7 @@ Size2 Button::get_minimum_size() const {
if (!_icon.is_null()) {
minsize.height = MAX(minsize.height, _icon->get_height());
if (icon_align != ALIGN_CENTER) {
if (icon_alignment != HORIZONTAL_ALIGNMENT_CENTER) {
minsize.width += _icon->get_width();
if (xl_text != "") {
minsize.width += get_theme_constant(SNAME("hseparation"));
@ -216,19 +216,19 @@ void Button::_notification(int p_what) {
}
Rect2 icon_region = Rect2();
TextAlign icon_align_rtl_checked = icon_align;
TextAlign align_rtl_checked = align;
HorizontalAlignment icon_align_rtl_checked = icon_alignment;
HorizontalAlignment align_rtl_checked = alignment;
// Swap icon and text alignment sides if right-to-left layout is set.
if (rtl) {
if (icon_align == ALIGN_RIGHT) {
icon_align_rtl_checked = ALIGN_LEFT;
} else if (icon_align == ALIGN_LEFT) {
icon_align_rtl_checked = ALIGN_RIGHT;
if (icon_alignment == HORIZONTAL_ALIGNMENT_RIGHT) {
icon_align_rtl_checked = HORIZONTAL_ALIGNMENT_LEFT;
} else if (icon_alignment == HORIZONTAL_ALIGNMENT_LEFT) {
icon_align_rtl_checked = HORIZONTAL_ALIGNMENT_RIGHT;
}
if (align == ALIGN_RIGHT) {
align_rtl_checked = ALIGN_LEFT;
} else if (align == ALIGN_LEFT) {
align_rtl_checked = ALIGN_RIGHT;
if (alignment == HORIZONTAL_ALIGNMENT_RIGHT) {
align_rtl_checked = HORIZONTAL_ALIGNMENT_LEFT;
} else if (alignment == HORIZONTAL_ALIGNMENT_LEFT) {
align_rtl_checked = HORIZONTAL_ALIGNMENT_RIGHT;
}
}
if (!_icon.is_null()) {
@ -240,14 +240,14 @@ void Button::_notification(int p_what) {
float icon_ofs_region = 0.0;
Point2 style_offset;
Size2 icon_size = _icon->get_size();
if (icon_align_rtl_checked == ALIGN_LEFT) {
if (icon_align_rtl_checked == HORIZONTAL_ALIGNMENT_LEFT) {
style_offset.x = style->get_margin(SIDE_LEFT);
if (_internal_margin[SIDE_LEFT] > 0) {
icon_ofs_region = _internal_margin[SIDE_LEFT] + get_theme_constant(SNAME("hseparation"));
}
} else if (icon_align_rtl_checked == ALIGN_CENTER) {
} else if (icon_align_rtl_checked == HORIZONTAL_ALIGNMENT_CENTER) {
style_offset.x = 0.0;
} else if (icon_align_rtl_checked == ALIGN_RIGHT) {
} else if (icon_align_rtl_checked == HORIZONTAL_ALIGNMENT_RIGHT) {
style_offset.x = -style->get_margin(SIDE_RIGHT);
if (_internal_margin[SIDE_RIGHT] > 0) {
icon_ofs_region = -_internal_margin[SIDE_RIGHT] - get_theme_constant(SNAME("hseparation"));
@ -258,7 +258,7 @@ void Button::_notification(int p_what) {
if (expand_icon) {
Size2 _size = get_size() - style->get_offset() * 2;
_size.width -= get_theme_constant(SNAME("hseparation")) + icon_ofs_region;
if (!clip_text && icon_align_rtl_checked != ALIGN_CENTER) {
if (!clip_text && icon_align_rtl_checked != HORIZONTAL_ALIGNMENT_CENTER) {
_size.width -= text_buf->get_size().width;
}
float icon_width = _icon->get_width() * _size.height / _icon->get_height();
@ -272,9 +272,9 @@ void Button::_notification(int p_what) {
icon_size = Size2(icon_width, icon_height);
}
if (icon_align_rtl_checked == ALIGN_LEFT) {
if (icon_align_rtl_checked == HORIZONTAL_ALIGNMENT_LEFT) {
icon_region = Rect2(style_offset + Point2(icon_ofs_region, Math::floor((valign - icon_size.y) * 0.5)), icon_size);
} else if (icon_align_rtl_checked == ALIGN_CENTER) {
} else if (icon_align_rtl_checked == HORIZONTAL_ALIGNMENT_CENTER) {
icon_region = Rect2(style_offset + Point2(icon_ofs_region + Math::floor((size.x - icon_size.x) * 0.5), Math::floor((valign - icon_size.y) * 0.5)), icon_size);
} else {
icon_region = Rect2(style_offset + Point2(icon_ofs_region + size.x - icon_size.x, Math::floor((valign - icon_size.y) * 0.5)), icon_size);
@ -286,7 +286,7 @@ void Button::_notification(int p_what) {
}
Point2 icon_ofs = !_icon.is_null() ? Point2(icon_region.size.width + get_theme_constant(SNAME("hseparation")), 0) : Point2();
if (align_rtl_checked == ALIGN_CENTER && icon_align_rtl_checked == ALIGN_CENTER) {
if (align_rtl_checked == HORIZONTAL_ALIGNMENT_CENTER && icon_align_rtl_checked == HORIZONTAL_ALIGNMENT_CENTER) {
icon_ofs.x = 0.0;
}
int text_clip = size.width - style->get_minimum_size().width - icon_ofs.width;
@ -304,8 +304,9 @@ void Button::_notification(int p_what) {
Point2 text_ofs = (size - style->get_minimum_size() - icon_ofs - text_buf->get_size() - Point2(_internal_margin[SIDE_RIGHT] - _internal_margin[SIDE_LEFT], 0)) / 2.0;
switch (align_rtl_checked) {
case ALIGN_LEFT: {
if (icon_align_rtl_checked != ALIGN_LEFT) {
case HORIZONTAL_ALIGNMENT_FILL:
case HORIZONTAL_ALIGNMENT_LEFT: {
if (icon_align_rtl_checked != HORIZONTAL_ALIGNMENT_LEFT) {
icon_ofs.x = 0.0;
}
if (_internal_margin[SIDE_LEFT] > 0) {
@ -315,23 +316,23 @@ void Button::_notification(int p_what) {
}
text_ofs.y += style->get_offset().y;
} break;
case ALIGN_CENTER: {
case HORIZONTAL_ALIGNMENT_CENTER: {
if (text_ofs.x < 0) {
text_ofs.x = 0;
}
if (icon_align_rtl_checked == ALIGN_LEFT) {
if (icon_align_rtl_checked == HORIZONTAL_ALIGNMENT_LEFT) {
text_ofs += icon_ofs;
}
text_ofs += style->get_offset();
} break;
case ALIGN_RIGHT: {
case HORIZONTAL_ALIGNMENT_RIGHT: {
if (_internal_margin[SIDE_RIGHT] > 0) {
text_ofs.x = size.x - style->get_margin(SIDE_RIGHT) - text_width - _internal_margin[SIDE_RIGHT] - get_theme_constant(SNAME("hseparation"));
} else {
text_ofs.x = size.x - style->get_margin(SIDE_RIGHT) - text_width;
}
text_ofs.y += style->get_offset().y;
if (icon_align_rtl_checked == ALIGN_RIGHT) {
if (icon_align_rtl_checked == HORIZONTAL_ALIGNMENT_RIGHT) {
text_ofs.x -= icon_ofs.x;
}
} break;
@ -471,25 +472,25 @@ bool Button::get_clip_text() const {
return clip_text;
}
void Button::set_text_align(TextAlign p_align) {
if (align != p_align) {
align = p_align;
void Button::set_text_alignment(HorizontalAlignment p_alignment) {
if (alignment != p_alignment) {
alignment = p_alignment;
update();
}
}
Button::TextAlign Button::get_text_align() const {
return align;
HorizontalAlignment Button::get_text_alignment() const {
return alignment;
}
void Button::set_icon_align(TextAlign p_align) {
icon_align = p_align;
void Button::set_icon_alignment(HorizontalAlignment p_alignment) {
icon_alignment = p_alignment;
update_minimum_size();
update();
}
Button::TextAlign Button::get_icon_align() const {
return icon_align;
HorizontalAlignment Button::get_icon_alignment() const {
return icon_alignment;
}
bool Button::_set(const StringName &p_name, const Variant &p_value) {
@ -558,25 +559,21 @@ void Button::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_flat"), &Button::is_flat);
ClassDB::bind_method(D_METHOD("set_clip_text", "enabled"), &Button::set_clip_text);
ClassDB::bind_method(D_METHOD("get_clip_text"), &Button::get_clip_text);
ClassDB::bind_method(D_METHOD("set_text_align", "align"), &Button::set_text_align);
ClassDB::bind_method(D_METHOD("get_text_align"), &Button::get_text_align);
ClassDB::bind_method(D_METHOD("set_icon_align", "icon_align"), &Button::set_icon_align);
ClassDB::bind_method(D_METHOD("get_icon_align"), &Button::get_icon_align);
ClassDB::bind_method(D_METHOD("set_text_alignment", "alignment"), &Button::set_text_alignment);
ClassDB::bind_method(D_METHOD("get_text_alignment"), &Button::get_text_alignment);
ClassDB::bind_method(D_METHOD("set_icon_alignment", "icon_alignment"), &Button::set_icon_alignment);
ClassDB::bind_method(D_METHOD("get_icon_alignment"), &Button::get_icon_alignment);
ClassDB::bind_method(D_METHOD("set_expand_icon", "enabled"), &Button::set_expand_icon);
ClassDB::bind_method(D_METHOD("is_expand_icon"), &Button::is_expand_icon);
BIND_ENUM_CONSTANT(ALIGN_LEFT);
BIND_ENUM_CONSTANT(ALIGN_CENTER);
BIND_ENUM_CONSTANT(ALIGN_RIGHT);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT, "", PROPERTY_USAGE_DEFAULT_INTL), "set_text", "get_text");
ADD_PROPERTY(PropertyInfo(Variant::INT, "text_direction", PROPERTY_HINT_ENUM, "Auto,Left-to-Right,Right-to-Left,Inherited"), "set_text_direction", "get_text_direction");
ADD_PROPERTY(PropertyInfo(Variant::STRING, "language"), "set_language", "get_language");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_button_icon", "get_button_icon");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flat"), "set_flat", "is_flat");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "clip_text"), "set_clip_text", "get_clip_text");
ADD_PROPERTY(PropertyInfo(Variant::INT, "align", PROPERTY_HINT_ENUM, "Left,Center,Right"), "set_text_align", "get_text_align");
ADD_PROPERTY(PropertyInfo(Variant::INT, "icon_align", PROPERTY_HINT_ENUM, "Left,Center,Right"), "set_icon_align", "get_icon_align");
ADD_PROPERTY(PropertyInfo(Variant::INT, "alignment", PROPERTY_HINT_ENUM, "Left,Center,Right"), "set_text_alignment", "get_text_alignment");
ADD_PROPERTY(PropertyInfo(Variant::INT, "icon_alignment", PROPERTY_HINT_ENUM, "Left,Center,Right"), "set_icon_alignment", "get_icon_alignment");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "expand_icon"), "set_expand_icon", "is_expand_icon");
}

View file

@ -37,13 +37,6 @@
class Button : public BaseButton {
GDCLASS(Button, BaseButton);
public:
enum TextAlign {
ALIGN_LEFT,
ALIGN_CENTER,
ALIGN_RIGHT
};
private:
bool flat = false;
String text;
@ -57,8 +50,8 @@ private:
Ref<Texture2D> icon;
bool expand_icon = false;
bool clip_text = false;
TextAlign align = ALIGN_CENTER;
TextAlign icon_align = ALIGN_LEFT;
HorizontalAlignment alignment = HORIZONTAL_ALIGNMENT_CENTER;
HorizontalAlignment icon_alignment = HORIZONTAL_ALIGNMENT_LEFT;
float _internal_margin[4] = {};
void _shape();
@ -100,16 +93,14 @@ public:
void set_clip_text(bool p_enabled);
bool get_clip_text() const;
void set_text_align(TextAlign p_align);
TextAlign get_text_align() const;
void set_text_alignment(HorizontalAlignment p_alignment);
HorizontalAlignment get_text_alignment() const;
void set_icon_align(TextAlign p_align);
TextAlign get_icon_align() const;
void set_icon_alignment(HorizontalAlignment p_alignment);
HorizontalAlignment get_icon_alignment() const;
Button(const String &p_text = String());
~Button();
};
VARIANT_ENUM_CAST(Button::TextAlign);
#endif

View file

@ -123,7 +123,7 @@ CheckBox::CheckBox(const String &p_text) :
Button(p_text) {
set_toggle_mode(true);
set_text_align(ALIGN_LEFT);
set_text_alignment(HORIZONTAL_ALIGNMENT_LEFT);
if (is_layout_rtl()) {
_set_internal_margin(SIDE_RIGHT, get_icon_size().width);

View file

@ -107,7 +107,7 @@ void CheckButton::_notification(int p_what) {
CheckButton::CheckButton() {
set_toggle_mode(true);
set_text_align(ALIGN_LEFT);
set_text_alignment(HORIZONTAL_ALIGNMENT_LEFT);
if (is_layout_rtl()) {
_set_internal_margin(SIDE_LEFT, get_icon_size().width);
} else {

View file

@ -170,12 +170,12 @@ void CodeEdit::_notification(int p_what) {
if (code_completion_options[l].default_value.get_type() == Variant::COLOR) {
draw_rect(Rect2(Point2(code_completion_rect.position.x, icon_area.position.y), icon_area_size), (Color)code_completion_options[l].default_value);
}
tl->set_align(HALIGN_RIGHT);
tl->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
} else {
if (code_completion_options[l].default_value.get_type() == Variant::COLOR) {
draw_rect(Rect2(Point2(code_completion_rect.position.x + code_completion_rect.size.width - icon_area_size.x, icon_area.position.y), icon_area_size), (Color)code_completion_options[l].default_value);
}
tl->set_align(HALIGN_LEFT);
tl->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_LEFT);
}
tl->draw(ci, title_pos, code_completion_options[l].font_color);
}
@ -229,7 +229,7 @@ void CodeEdit::_notification(int p_what) {
Point2 round_ofs = hint_ofs + sb->get_offset() + Vector2(0, font->get_ascent(font_size) + font_height * i + yofs);
round_ofs = round_ofs.round();
draw_string(font, round_ofs, line.replace(String::chr(0xFFFF), ""), HALIGN_LEFT, -1, font_size, font_color);
draw_string(font, round_ofs, line.replace(String::chr(0xFFFF), ""), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color);
if (end > 0) {
// Draw an underline for the currently edited function parameter.
const Vector2 b = hint_ofs + sb->get_offset() + Vector2(begin, font_height + font_height * i + yofs);

View file

@ -1274,7 +1274,7 @@ ColorPicker::ColorPicker() :
preset_container->set_columns(preset_column_count);
add_child(preset_container, false, INTERNAL_MODE_FRONT);
btn_add_preset->set_icon_align(Button::ALIGN_CENTER);
btn_add_preset->set_icon_alignment(HORIZONTAL_ALIGNMENT_CENTER);
btn_add_preset->set_tooltip(RTR("Add current color as a preset."));
btn_add_preset->connect("pressed", callable_mp(this, &ColorPicker::_add_preset_pressed));
preset_container->add_child(btn_add_preset);

View file

@ -1000,8 +1000,8 @@ FileDialog::FileDialog() {
message = memnew(Label);
message->hide();
message->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
message->set_align(Label::ALIGN_CENTER);
message->set_valign(Label::VALIGN_CENTER);
message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
message->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
tree->add_child(message);
file_box = memnew(HBoxContainer);

Some files were not shown because too many files have changed in this diff Show more