mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 03:18:37 +08:00
[Complex Text Layouts] Add TextServer documentation. Update Font, CanvasItem, Theme and modified controls documentation.
This commit is contained in:
parent
3be31c4960
commit
7e2c0ffd1a
@ -1236,6 +1236,9 @@
|
||||
<member name="ResourceSaver" type="ResourceSaver" setter="" getter="">
|
||||
The [ResourceSaver] singleton.
|
||||
</member>
|
||||
<member name="TextServerManager" type="TextServerManager" setter="" getter="">
|
||||
The [TextServerManager] singleton.
|
||||
</member>
|
||||
<member name="TranslationServer" type="TranslationServer" setter="" getter="">
|
||||
The [TranslationServer] singleton.
|
||||
</member>
|
||||
@ -1286,6 +1289,9 @@
|
||||
<constant name="HALIGN_RIGHT" value="2" enum="HAlign">
|
||||
Horizontal right alignment, usually for text-derived classes.
|
||||
</constant>
|
||||
<constant name="HALIGN_FILL" value="3" enum="HAlign">
|
||||
Expand row to fit width, usually for text-derived classes.
|
||||
</constant>
|
||||
<constant name="VALIGN_TOP" value="0" enum="VAlign">
|
||||
Vertical top alignment, usually for text-derived classes.
|
||||
</constant>
|
||||
|
@ -40,6 +40,33 @@
|
||||
<link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="clear_opentype_features">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
Removes all OpenType features.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_opentype_feature" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="tag" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns OpenType feature [code]tag[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_opentype_feature">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="tag" type="String">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="align" type="int" setter="set_text_align" getter="get_text_align" enum="Button.TextAlign" default="1">
|
||||
@ -57,9 +84,15 @@
|
||||
<member name="icon" type="Texture2D" setter="set_button_icon" getter="get_button_icon">
|
||||
Button's icon, if text is present the icon will be placed before the text.
|
||||
</member>
|
||||
<member name="language" type="String" setter="set_language" getter="get_language" default="""">
|
||||
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
|
||||
</member>
|
||||
<member name="text" type="String" setter="set_text" getter="get_text" default="""">
|
||||
The button's text that will be displayed inside the button's area.
|
||||
</member>
|
||||
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
|
||||
Base text writing direction.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
<constant name="ALIGN_LEFT" value="0" enum="TextAlign">
|
||||
@ -94,6 +127,12 @@
|
||||
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
Text [Color] used when the [Button] is being pressed.
|
||||
</theme_item>
|
||||
<theme_item name="font_outline_modulate" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
Text oubline [Color] of the [Button].
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the [Button]'s text.
|
||||
</theme_item>
|
||||
<theme_item name="hover" type="StyleBox">
|
||||
[StyleBox] used when the [Button] is being hovered.
|
||||
</theme_item>
|
||||
@ -103,6 +142,9 @@
|
||||
<theme_item name="normal" type="StyleBox">
|
||||
Default [StyleBox] for the [Button].
|
||||
</theme_item>
|
||||
<theme_item name="outline_size" type="int" default="0">
|
||||
Size of the [Button]'s text outline.
|
||||
</theme_item>
|
||||
<theme_item name="pressed" type="StyleBox">
|
||||
[StyleBox] used when the [Button] is being pressed.
|
||||
</theme_item>
|
||||
|
@ -45,18 +45,24 @@
|
||||
Draws an arc between the given angles. The larger the value of [code]point_count[/code], the smoother the curve.
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_char">
|
||||
<method name="draw_char" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="font" type="Font">
|
||||
</argument>
|
||||
<argument index="1" name="position" type="Vector2">
|
||||
<argument index="1" name="pos" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="char" type="String">
|
||||
</argument>
|
||||
<argument index="3" name="next" type="String">
|
||||
<argument index="3" name="next" type="String" default="""">
|
||||
</argument>
|
||||
<argument index="4" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
<argument index="4" name="size" type="int" default="-1">
|
||||
</argument>
|
||||
<argument index="5" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<argument index="6" name="outline_size" type="int" default="0">
|
||||
</argument>
|
||||
<argument index="7" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )">
|
||||
</argument>
|
||||
<description>
|
||||
Draws a string character using a custom font. Returns the advance, depending on the character width and kerning with an optional next character.
|
||||
@ -146,6 +152,35 @@
|
||||
Draws multiple, parallel lines with a uniform [code]width[/code] and segment-by-segment coloring. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_multiline_string" qualifiers="const">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="font" type="Font">
|
||||
</argument>
|
||||
<argument index="1" name="pos" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="text" type="String">
|
||||
</argument>
|
||||
<argument index="3" name="align" type="int" enum="HAlign" default="0">
|
||||
</argument>
|
||||
<argument index="4" name="width" type="float" default="-1">
|
||||
</argument>
|
||||
<argument index="5" name="max_lines" type="int" default="-1">
|
||||
</argument>
|
||||
<argument index="6" name="size" type="int" default="-1">
|
||||
</argument>
|
||||
<argument index="7" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<argument index="8" name="outline_size" type="int" default="0">
|
||||
</argument>
|
||||
<argument index="9" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )">
|
||||
</argument>
|
||||
<argument index="10" name="flags" type="int" default="51">
|
||||
</argument>
|
||||
<description>
|
||||
Breaks [code]text[/code] to the lines and draws it using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width.
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_multimesh">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -253,18 +288,28 @@
|
||||
Sets a custom transform for drawing via matrix. Anything drawn afterwards will be transformed by this.
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_string">
|
||||
<method name="draw_string" qualifiers="const">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="font" type="Font">
|
||||
</argument>
|
||||
<argument index="1" name="position" type="Vector2">
|
||||
<argument index="1" name="pos" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="text" type="String">
|
||||
</argument>
|
||||
<argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
<argument index="3" name="align" type="int" enum="HAlign" default="0">
|
||||
</argument>
|
||||
<argument index="4" name="clip_w" type="int" default="-1">
|
||||
<argument index="4" name="width" type="float" default="-1">
|
||||
</argument>
|
||||
<argument index="5" name="size" type="int" default="-1">
|
||||
</argument>
|
||||
<argument index="6" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<argument index="7" name="outline_size" type="int" default="0">
|
||||
</argument>
|
||||
<argument index="8" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )">
|
||||
</argument>
|
||||
<argument index="9" name="flags" type="int" default="3">
|
||||
</argument>
|
||||
<description>
|
||||
Draws [code]text[/code] using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width.
|
||||
@ -275,17 +320,19 @@
|
||||
# `default_font` declaration to a member variable assigned in `_ready()`
|
||||
# so the Control is only created once.
|
||||
var default_font = Control.new().get_font("font")
|
||||
draw_string(default_font, Vector2(64, 64), "Hello world")
|
||||
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)
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
// If using this method in a script that redraws constantly, move the
|
||||
// `default_font` declaration to a member variable assigned in `_ready()`
|
||||
// so the Control is only created once.
|
||||
Font defaultFont = new Control().GetFont("font");
|
||||
DrawString(defaultFont, new Vector2(64, 64), "Hello world");
|
||||
int defaultFontSize = new Control().GetFontSize("font_size");
|
||||
DrawString(defaultFont, new Vector2(64, 64), "Hello world", HALIGN_LEFT, -1, defaultFontSize);
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
See also [method Font.draw].
|
||||
See also [method Font.draw_string].
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_style_box">
|
||||
|
@ -48,6 +48,9 @@
|
||||
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
The [CheckBox] text's font color when it's pressed.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the [CheckBox]'s text.
|
||||
</theme_item>
|
||||
<theme_item name="hover" type="StyleBox">
|
||||
The [StyleBox] to display as a background when the [CheckBox] is hovered.
|
||||
</theme_item>
|
||||
|
@ -45,6 +45,9 @@
|
||||
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
The [CheckButton] text's font color when it's pressed.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the [CheckButton]'s text.
|
||||
</theme_item>
|
||||
<theme_item name="hover" type="StyleBox">
|
||||
The [StyleBox] to display as a background when the [CheckButton] is hovered.
|
||||
</theme_item>
|
||||
@ -58,16 +61,28 @@
|
||||
The [StyleBox] to display as a background.
|
||||
</theme_item>
|
||||
<theme_item name="off" type="Texture2D">
|
||||
The icon to display when the [CheckButton] is unchecked.
|
||||
The icon to display when the [CheckButton] is unchecked (for left-to-right layouts).
|
||||
</theme_item>
|
||||
<theme_item name="off_disabled" type="Texture2D">
|
||||
The icon to display when the [CheckButton] is unchecked and disabled.
|
||||
The icon to display when the [CheckButton] is unchecked and disabled (for left-to-right layouts).
|
||||
</theme_item>
|
||||
<theme_item name="off_disabled_mirrored" type="Texture2D">
|
||||
The icon to display when the [CheckButton] is unchecked and disabled (for right-to-left layouts).
|
||||
</theme_item>
|
||||
<theme_item name="off_mirrored" type="Texture2D">
|
||||
The icon to display when the [CheckButton] is unchecked (for right-to-left layouts).
|
||||
</theme_item>
|
||||
<theme_item name="on" type="Texture2D">
|
||||
The icon to display when the [CheckButton] is checked.
|
||||
The icon to display when the [CheckButton] is checked (for left-to-right layouts).
|
||||
</theme_item>
|
||||
<theme_item name="on_disabled" type="Texture2D">
|
||||
The icon to display when the [CheckButton] is checked and disabled.
|
||||
The icon to display when the [CheckButton] is checked and disabled (for left-to-right layouts).
|
||||
</theme_item>
|
||||
<theme_item name="on_disabled_mirrored" type="Texture2D">
|
||||
The icon to display when the [CheckButton] is checked and disabled (for right-to-left layouts).
|
||||
</theme_item>
|
||||
<theme_item name="on_mirrored" type="Texture2D">
|
||||
The icon to display when the [CheckButton] is checked (for right-to-left layouts).
|
||||
</theme_item>
|
||||
<theme_item name="pressed" type="StyleBox">
|
||||
The [StyleBox] to display as a background when the [CheckButton] is pressed.
|
||||
|
@ -110,6 +110,9 @@
|
||||
</member>
|
||||
<member name="draw_line_numbers" type="bool" setter="set_draw_line_numbers" getter="is_draw_line_numbers_enabled" default="false">
|
||||
</member>
|
||||
<member name="layout_direction" type="int" setter="set_layout_direction" getter="get_layout_direction" override="true" enum="Control.LayoutDirection" default="2" />
|
||||
<member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" override="true" default="[ ]" />
|
||||
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" override="true" enum="Control.TextDirection" default="1" />
|
||||
<member name="zero_pad_line_numbers" type="bool" setter="set_line_numbers_zero_padded" getter="is_line_numbers_zero_padded" default="false">
|
||||
</member>
|
||||
</members>
|
||||
@ -180,6 +183,9 @@
|
||||
</theme_item>
|
||||
<theme_item name="font_color_selected" type="Color" default="Color( 0, 0, 0, 1 )">
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the [CodeEdit]'s text.
|
||||
</theme_item>
|
||||
<theme_item name="line_number_color" type="Color" default="Color( 0.67, 0.67, 0.67, 0.4 )">
|
||||
</theme_item>
|
||||
<theme_item name="line_spacing" type="int" default="4">
|
||||
|
@ -82,6 +82,9 @@
|
||||
<theme_item name="font_color_pressed" type="Color" default="Color( 0.8, 0.8, 0.8, 1 )">
|
||||
Text [Color] used when the [ColorPickerButton] is being pressed.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the [ColorPickerButton]'s text.
|
||||
</theme_item>
|
||||
<theme_item name="hover" type="StyleBox">
|
||||
[StyleBox] used when the [ColorPickerButton] is being hovered.
|
||||
</theme_item>
|
||||
|
@ -121,6 +121,18 @@
|
||||
[/codeblocks]
|
||||
</description>
|
||||
</method>
|
||||
<method name="_structured_text_parser" qualifiers="virtual">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="args" type="Array">
|
||||
</argument>
|
||||
<argument index="1" name="text" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
User defined BiDi algorithm override function.
|
||||
Return [code]Array[/code] of [code]Vector2i[/code] text ranges, in the left-to-right order. Ranges should cover full source [code]text[/code] without overlaps. BiDi algorithm will be used on each range separately.
|
||||
</description>
|
||||
</method>
|
||||
<method name="accept_event">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -179,6 +191,17 @@
|
||||
Overrides the font with given [code]name[/code] in the [member theme] resource the control uses. If [code]font[/code] is [code]null[/code] or invalid, the override is cleared and the font from assigned [Theme] is used.
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_theme_font_size_override">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="font_size" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Overrides the font size with given [code]name[/code] in the [member theme] resource the control uses. If [code]font_size[/code] is [code]-1[/code], the override is cleared and the font size from assigned [Theme] is used.
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_theme_icon_override">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -443,7 +466,7 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
<argument index="1" name="node_type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns a color from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
|
||||
@ -466,7 +489,7 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
<argument index="1" name="node_type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns a constant from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
|
||||
@ -477,18 +500,29 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
<argument index="1" name="node_type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns a font from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_theme_font_size" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="node_type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns a font size from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_theme_icon" qualifiers="const">
|
||||
<return type="Texture2D">
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
<argument index="1" name="node_type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns an icon from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
|
||||
@ -499,7 +533,7 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
<argument index="1" name="node_type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns a [StyleBox] from assigned [Theme] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code].
|
||||
@ -563,7 +597,7 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
<argument index="1" name="node_type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if [Color] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
|
||||
@ -583,7 +617,7 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
<argument index="1" name="node_type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if constant with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
|
||||
@ -603,7 +637,7 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
<argument index="1" name="node_type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if font with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
|
||||
@ -618,12 +652,32 @@
|
||||
Returns [code]true[/code] if font with given [code]name[/code] has a valid override in this [Control] node.
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_theme_font_size" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="node_type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if font size with given [code]name[/code] and associated with [Control] of given [code]type[/code] exists in assigned [Theme].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_theme_font_size_override" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if font size with given [code]name[/code] has a valid override in this [Control] node.
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_theme_icon" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
<argument index="1" name="node_type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if icon with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
|
||||
@ -652,7 +706,7 @@
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
<argument index="1" name="node_type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if [StyleBox] with given [code]name[/code] and associated with [Control] of given [code]node_type[/code] exists in assigned [Theme].
|
||||
@ -667,6 +721,13 @@
|
||||
Returns [code]true[/code] if [StyleBox] with given [code]name[/code] has a valid override in this [Control] node.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_layout_rtl" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<description>
|
||||
Returns [code]true[/code] if layout is right-to-left.
|
||||
</description>
|
||||
</method>
|
||||
<method name="minimum_size_changed">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -1015,6 +1076,9 @@
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
</member>
|
||||
<member name="layout_direction" type="int" setter="set_layout_direction" getter="get_layout_direction" enum="Control.LayoutDirection" default="0">
|
||||
Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew).
|
||||
</member>
|
||||
<member name="margin_bottom" type="float" setter="set_margin" getter="get_margin" default="0.0">
|
||||
Distance between the node's bottom edge and its parent control, based on [member anchor_bottom].
|
||||
Margins are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Margins update automatically when you move or resize the node.
|
||||
@ -1159,6 +1223,9 @@
|
||||
<constant name="NOTIFICATION_SCROLL_END" value="48">
|
||||
Sent when this node is inside a [ScrollContainer] which has stopped being scrolled.
|
||||
</constant>
|
||||
<constant name="NOTIFICATION_LAYOUT_DIRECTION_CHANGED" value="49">
|
||||
Sent when control layout direction is changed.
|
||||
</constant>
|
||||
<constant name="CURSOR_ARROW" value="0" enum="CursorShape">
|
||||
Show the system's arrow mouse cursor when the user hovers the node. Use with [member mouse_default_cursor_shape].
|
||||
</constant>
|
||||
@ -1309,5 +1376,51 @@
|
||||
<constant name="ANCHOR_END" value="1" enum="Anchor">
|
||||
Snaps one of the 4 anchor's sides to the end of the node's [code]Rect[/code], in the bottom right. Use it with one of the [code]anchor_*[/code] member variables, like [member anchor_left]. To change all 4 anchors at once, use [method set_anchors_preset].
|
||||
</constant>
|
||||
<constant name="LAYOUT_DIRECTION_INHERITED" value="0" enum="LayoutDirection">
|
||||
Automatic layout direction, determined from the parent control layout direction.
|
||||
</constant>
|
||||
<constant name="LAYOUT_DIRECTION_LOCALE" value="1" enum="LayoutDirection">
|
||||
Automatic layout direction, determined from the current locale.
|
||||
</constant>
|
||||
<constant name="LAYOUT_DIRECTION_LTR" value="2" enum="LayoutDirection">
|
||||
Left-to-right layout direction.
|
||||
</constant>
|
||||
<constant name="LAYOUT_DIRECTION_RTL" value="3" enum="LayoutDirection">
|
||||
Right-to-left layout direction.
|
||||
</constant>
|
||||
<constant name="TEXT_DIRECTION_INHERITED" value="3" enum="TextDirection">
|
||||
Text writing direction is the same as layout direction.
|
||||
</constant>
|
||||
<constant name="TEXT_DIRECTION_AUTO" value="0" enum="TextDirection">
|
||||
Automatic text writing direction, determined from the current locale and text content.
|
||||
</constant>
|
||||
<constant name="TEXT_DIRECTION_LTR" value="1" enum="TextDirection">
|
||||
Left-to-right text writing direction.
|
||||
</constant>
|
||||
<constant name="TEXT_DIRECTION_RTL" value="2" enum="TextDirection">
|
||||
Right-to-left text writing direction.
|
||||
</constant>
|
||||
<constant name="STRUCTURED_TEXT_DEFAULT" value="0" enum="StructuredTextParser">
|
||||
Use default behavior. Same as [code]STRUCTURED_TEXT_NONE[/code] unless specified otherwise in the control description.
|
||||
</constant>
|
||||
<constant name="STRUCTURED_TEXT_URI" value="1" enum="StructuredTextParser">
|
||||
BiDi override for URI.
|
||||
</constant>
|
||||
<constant name="STRUCTURED_TEXT_FILE" value="2" enum="StructuredTextParser">
|
||||
BiDi override for file path.
|
||||
</constant>
|
||||
<constant name="STRUCTURED_TEXT_EMAIL" value="3" enum="StructuredTextParser">
|
||||
BiDi override for email.
|
||||
</constant>
|
||||
<constant name="STRUCTURED_TEXT_LIST" value="4" enum="StructuredTextParser">
|
||||
BiDi override for lists.
|
||||
Structured text options: list separator [code]String[/code].
|
||||
</constant>
|
||||
<constant name="STRUCTURED_TEXT_NONE" value="5" enum="StructuredTextParser">
|
||||
Use default Unicode BiDi algorithm.
|
||||
</constant>
|
||||
<constant name="STRUCTURED_TEXT_CUSTOM" value="6" enum="StructuredTextParser">
|
||||
User defined structured text BiDi override function.
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
||||
|
@ -1,146 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="DynamicFont" inherits="Font" version="4.0">
|
||||
<brief_description>
|
||||
DynamicFont renders vector font files at runtime.
|
||||
</brief_description>
|
||||
<description>
|
||||
DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like [BitmapFont]. This trades the faster loading time of [BitmapFont]s for the ability to change font parameters like size and spacing during runtime. [DynamicFontData] is used for referencing the font file paths. DynamicFont also supports defining one or more fallback fonts, which will be used when displaying a character not supported by the main font.
|
||||
DynamicFont uses the [url=https://www.freetype.org/]FreeType[/url] library for rasterization.
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
var dynamic_font = DynamicFont.new()
|
||||
dynamic_font.font_data = load("res://BarlowCondensed-Bold.ttf")
|
||||
dynamic_font.size = 64
|
||||
$"Label".set("custom_fonts/font", dynamic_font)
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
var dynamicFont = new DynamicFont();
|
||||
dynamicFont.FontData = ResourceLoader.Load<DynamicFontData>("res://BarlowCondensed-Bold.ttf");
|
||||
dynamicFont.Size = 64;
|
||||
GetNode("Label").Set("custom_fonts/font", dynamicFont);
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
[b]Note:[/b] DynamicFont doesn't support features such as kerning, right-to-left typesetting, ligatures, text shaping, variable fonts and optional font features yet. If you wish to "bake" an optional font feature into a TTF font file, you can use [url=https://fontforge.org/]FontForge[/url] to do so. In FontForge, use [b]File > Generate Fonts[/b], click [b]Options[/b], choose the desired features then generate the font.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="add_fallback">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="data" type="DynamicFontData">
|
||||
</argument>
|
||||
<description>
|
||||
Adds a fallback font.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_available_chars" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
<description>
|
||||
Returns a string containing all the characters available in the main and all the fallback fonts.
|
||||
If a given character is included in more than one font, it appears only once in the returned string.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_fallback" qualifiers="const">
|
||||
<return type="DynamicFontData">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the fallback font at index [code]idx[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_fallback_count" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
Returns the number of fallback fonts.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_spacing" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="type" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the spacing for the given [code]type[/code] (see [enum SpacingType]).
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_fallback">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Removes the fallback font at index [code]idx[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_fallback">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="data" type="DynamicFontData">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the fallback font at index [code]idx[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_spacing">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="type" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the spacing for [code]type[/code] (see [enum SpacingType]) to [code]value[/code] in pixels (not relative to the font size).
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="extra_spacing_bottom" type="int" setter="set_spacing" getter="get_spacing" default="0">
|
||||
Extra spacing at the bottom in pixels.
|
||||
</member>
|
||||
<member name="extra_spacing_char" type="int" setter="set_spacing" getter="get_spacing" default="0">
|
||||
Extra spacing for each character in pixels.
|
||||
This can be a negative number to make the distance between characters smaller.
|
||||
</member>
|
||||
<member name="extra_spacing_space" type="int" setter="set_spacing" getter="get_spacing" default="0">
|
||||
Extra spacing for the space character (in addition to [member extra_spacing_char]) in pixels.
|
||||
This can be a negative number to make the distance between words smaller.
|
||||
</member>
|
||||
<member name="extra_spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0">
|
||||
Extra spacing at the top in pixels.
|
||||
</member>
|
||||
<member name="font_data" type="DynamicFontData" setter="set_font_data" getter="get_font_data">
|
||||
The font data.
|
||||
</member>
|
||||
<member name="outline_color" type="Color" setter="set_outline_color" getter="get_outline_color" default="Color( 1, 1, 1, 1 )">
|
||||
The font outline's color.
|
||||
[b]Note:[/b] It's recommended to leave this at the default value so that you can adjust it in individual controls. For example, if the outline is made black here, it won't be possible to change its color using a Label's font outline modulate theme item.
|
||||
</member>
|
||||
<member name="outline_size" type="int" setter="set_outline_size" getter="get_outline_size" default="0">
|
||||
The font outline's thickness in pixels (not relative to the font size).
|
||||
</member>
|
||||
<member name="size" type="int" setter="set_size" getter="get_size" default="16">
|
||||
The font size in pixels.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
<constant name="SPACING_TOP" value="0" enum="SpacingType">
|
||||
Spacing at the top.
|
||||
</constant>
|
||||
<constant name="SPACING_BOTTOM" value="1" enum="SpacingType">
|
||||
Spacing at the bottom.
|
||||
</constant>
|
||||
<constant name="SPACING_CHAR" value="2" enum="SpacingType">
|
||||
Spacing for each character.
|
||||
</constant>
|
||||
<constant name="SPACING_SPACE" value="3" enum="SpacingType">
|
||||
Spacing for the space character.
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
346
doc/classes/Font.xml
Normal file
346
doc/classes/Font.xml
Normal file
@ -0,0 +1,346 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="Font" inherits="Resource" version="4.0">
|
||||
<brief_description>
|
||||
Font class is set of font data sources used to draw text.
|
||||
</brief_description>
|
||||
<description>
|
||||
Font contains a set of glyphs to represent Unicode characters, as well as the ability to draw it with variable width, ascent, descent and kerning.
|
||||
[b]Note:[/b] A character is a symbol that represents an item (letter, digit etc.) in an abstract way.
|
||||
[b]Note:[/b] A glyph is a bitmap or shape used to draw a one or more characters in a context-dependent manner. Glyph indices are bound to the specific font data source.
|
||||
[b]Note:[/b] If a non of the font data sources contain glyphs for a character used in a string, the character in question will be replaced with a box displaying its hexadecimal code.
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
var font = Font.new()
|
||||
font.add_data(load("res://BarlowCondensed-Bold.ttf"))
|
||||
$"Label".set("custom_fonts/font", font)
|
||||
$"Label".set("custom_fonts/font_size", 64)
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
var font = new Font();
|
||||
font.AddData(ResourceLoader.Load<FontData>("res://BarlowCondensed-Bold.ttf"));
|
||||
GetNode("Label").Set("custom_fonts/font", font);
|
||||
GetNode("Label").Set("custom_font_sizes/font_size", 64);
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
To control font substitution priority use [FontData] language and script support.
|
||||
Use language overrides to use same [Font] stack for multiple languages:
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
# Use Naskh font for Persian and Nastaʼlīq font for Urdu text.
|
||||
var font_data_fa = load("res://NotoNaskhArabicUI_Regular.ttf");
|
||||
font_data_fa.set_language_support_override("fa", true);
|
||||
font_data_fa.set_language_support_override("ur", false);
|
||||
|
||||
var font_data_ur = load("res://NotoNastaliqUrdu_Regular.ttf");
|
||||
font_data_ur.set_language_support_override("fa", false);
|
||||
font_data_ur.set_language_support_override("ur", true);
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
// Use Naskh font for Persian and Nastaʼlīq font for Urdu text.
|
||||
var fontDataFA = ResourceLoader.Load<FontData>("res://NotoNaskhArabicUI_Regular.ttf");
|
||||
fontDataFA.SetLanguageSupportOverride("fa", true);
|
||||
fontDataFA.SetLanguageSupportOverride("ur", false);
|
||||
|
||||
var fontDataUR = ResourceLoader.Load<FontData>("res://NotoNastaliqUrdu_Regular.ttf");
|
||||
fontDataUR.SetLanguageSupportOverride("fa", false);
|
||||
fontDataUR.SetLanguageSupportOverride("ur", true);
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
Use script overrides to specify supported scripts for bitmap font or for less common scripts not directly supported by TrueType format:
|
||||
[codeblocks]
|
||||
[gdscript]
|
||||
# Use specified font for Egyptian hieroglyphs.
|
||||
var font_data = load("res://unifont.ttf");
|
||||
font_data.set_script_support_override("Egyp", true);
|
||||
[/gdscript]
|
||||
[csharp]
|
||||
// Use specified font for Egyptian hieroglyphs.
|
||||
var fontData = ResourceLoader.Load<FontData>("res://unifont.ttf");
|
||||
fontData.SetScriptSupportOverride("Egyp", true);
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="add_data">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="data" type="FontData">
|
||||
</argument>
|
||||
<description>
|
||||
Add font data source to the set.
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_char" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="canvas_item" type="RID">
|
||||
</argument>
|
||||
<argument index="1" name="pos" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="char" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="next" type="int" default="0">
|
||||
</argument>
|
||||
<argument index="4" name="size" type="int" default="-1">
|
||||
</argument>
|
||||
<argument index="5" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<argument index="6" name="outline_size" type="int" default="0">
|
||||
</argument>
|
||||
<argument index="7" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )">
|
||||
</argument>
|
||||
<description>
|
||||
Draw a single Unicode character [code]char[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color, and optionally kerning if [code]next[/code] is passed. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis.
|
||||
[b]Note:[/b] Do not use this function to draw strings character by character, use [method draw_string] or [TextLine] instead.
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_multiline_string" qualifiers="const">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="canvas_item" type="RID">
|
||||
</argument>
|
||||
<argument index="1" name="pos" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="text" type="String">
|
||||
</argument>
|
||||
<argument index="3" name="align" type="int" enum="HAlign" default="0">
|
||||
</argument>
|
||||
<argument index="4" name="width" type="float" default="-1">
|
||||
</argument>
|
||||
<argument index="5" name="max_lines" type="int" default="-1">
|
||||
</argument>
|
||||
<argument index="6" name="size" type="int" default="-1">
|
||||
</argument>
|
||||
<argument index="7" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<argument index="8" name="outline_size" type="int" default="0">
|
||||
</argument>
|
||||
<argument index="9" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )">
|
||||
</argument>
|
||||
<argument index="10" name="flags" type="int" default="51">
|
||||
</argument>
|
||||
<description>
|
||||
Breaks [code]text[/code] to the lines using rules specified by [code]flags[/code] and draws it into a canvas item using the font, at a given position, with [code]modulate[/code] color, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline of the first line, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis.
|
||||
See also [method CanvasItem.draw_multiline_string].
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_string" qualifiers="const">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="canvas_item" type="RID">
|
||||
</argument>
|
||||
<argument index="1" name="pos" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="text" type="String">
|
||||
</argument>
|
||||
<argument index="3" name="align" type="int" enum="HAlign" default="0">
|
||||
</argument>
|
||||
<argument index="4" name="width" type="float" default="-1">
|
||||
</argument>
|
||||
<argument index="5" name="size" type="int" default="-1">
|
||||
</argument>
|
||||
<argument index="6" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<argument index="7" name="outline_size" type="int" default="0">
|
||||
</argument>
|
||||
<argument index="8" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 0 )">
|
||||
</argument>
|
||||
<argument index="9" name="flags" type="int" default="3">
|
||||
</argument>
|
||||
<description>
|
||||
Draw [code]text[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis.
|
||||
See also [method CanvasItem.draw_string].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_ascent" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="size" type="int" default="-1">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the average font ascent (number of pixels above the baseline).
|
||||
[b]Note:[/b] Real ascent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the ascent of empty line).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_char_size" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<argument index="0" name="char" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="next" type="int" default="0">
|
||||
</argument>
|
||||
<argument index="2" name="size" type="int" default="-1">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the size of a character, optionally taking kerning into account if the next character is provided.
|
||||
[b]Note:[/b] Do not use this function to calculate width of the string character by character, use [method get_string_size] or [TextLine] instead.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_data" qualifiers="const">
|
||||
<return type="FontData">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the font data source at index [code]idx[/code]. If the index does not exist, returns [code]null[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_data_count" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
Returns the number of font data sources.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_descent" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="size" type="int" default="-1">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the average font descent (number of pixels below the baseline).
|
||||
[b]Note:[/b] Real descent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the descent of empty line).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_height" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="size" type="int" default="-1">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the total average font height (ascent plus descent) in pixels.
|
||||
[b]Note:[/b] Real height of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the height of empty line).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_multiline_string_size" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<argument index="0" name="text" type="String">
|
||||
</argument>
|
||||
<argument index="1" name="width" type="float" default="-1">
|
||||
</argument>
|
||||
<argument index="2" name="size" type="int" default="-1">
|
||||
</argument>
|
||||
<argument index="3" name="flags" type="int" default="48">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the size of a bounding box of a string broken into the lines, taking kerning and advance into account.
|
||||
See also [method draw_multiline_string].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_spacing" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="type" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the spacing for the given [code]type[/code] (see [enum SpacingType]).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_string_size" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<argument index="0" name="text" type="String">
|
||||
</argument>
|
||||
<argument index="1" name="size" type="int" default="-1">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the size size of a bounding box of a string, taking kerning and advance into account.
|
||||
See also [method draw_string].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_supported_chars" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
<description>
|
||||
Returns a string containing all the characters available in the font.
|
||||
If a given character is included in more than one font data source, it appears only once in the returned string.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_underline_position" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="size" type="int" default="-1">
|
||||
</argument>
|
||||
<description>
|
||||
Return average pixel offset of the underline below the baseline.
|
||||
[b]Note:[/b] Real underline position of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_underline_thickness" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="size" type="int" default="-1">
|
||||
</argument>
|
||||
<description>
|
||||
Return average thickness of the underline.
|
||||
[b]Note:[/b] Real underline thickness of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate.
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_char" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="char" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Return [code]true[/code] if a Unicode [code]char[/code] is available in the font.
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_data">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Removes the font data source at index [code]idx[/code]. If the index does not exist, nothing happens.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_data">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="data" type="FontData">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the font data source at index [code]idx[/code]. If the index does not exist, nothing happens.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_spacing">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="type" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the spacing for [code]type[/code] (see [enum SpacingType]) to [code]value[/code] in pixels (not relative to the font size).
|
||||
</description>
|
||||
</method>
|
||||
<method name="update_changes">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
After editing a font (changing data sources, etc.). Call this function to propagate changes to controls that might use it.
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="extra_spacing_bottom" type="int" setter="set_spacing" getter="get_spacing" default="0">
|
||||
Extra spacing at the bottom in pixels.
|
||||
</member>
|
||||
<member name="extra_spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0">
|
||||
Extra character spacing in pixels.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
<constant name="SPACING_TOP" value="0" enum="SpacingType">
|
||||
Spacing at the top of the line.
|
||||
</constant>
|
||||
<constant name="SPACING_BOTTOM" value="1" enum="SpacingType">
|
||||
Spacing at the bottom of the line.
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
302
doc/classes/FontData.xml
Normal file
302
doc/classes/FontData.xml
Normal file
@ -0,0 +1,302 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="FontData" inherits="Resource" version="4.0">
|
||||
<brief_description>
|
||||
Font data source, file or memory buffer.
|
||||
</brief_description>
|
||||
<description>
|
||||
Built-in text servers support font data sources of the following formats:
|
||||
- Bitmap fonts in the [url=https://www.angelcode.com/products/bmfont/]BMFont[/url] format. Handles [code].fnt, *.font[/code] fonts containing texture atlases. Non-scalable. Supports distance fields. Complex text shaping support is limited.
|
||||
- Dynamic fonts using the [url=https://www.freetype.org/]FreeType[/url] and [url=https://github.com/silnrsi/graphite/]Graphite[/url] library for rasterization. Handles [code]*.ttf, *.otf[/code] fonts. Scalable. Doesn't support distance fields. Supports complex text shaping and OpenType features.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="draw_glyph" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<argument index="0" name="canvas" type="RID">
|
||||
</argument>
|
||||
<argument index="1" name="size" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="pos" type="Vector2">
|
||||
</argument>
|
||||
<argument index="3" name="index" type="int">
|
||||
</argument>
|
||||
<argument index="4" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<description>
|
||||
Draws single glyph into a canvas item at the position, using [code]font[/code] at the size [code]size[/code].
|
||||
Returns advance of the glyph for horizontal and vertical layouts.
|
||||
Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_glyph_outline" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<argument index="0" name="canvas" type="RID">
|
||||
</argument>
|
||||
<argument index="1" name="size" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="outline_size" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="pos" type="Vector2">
|
||||
</argument>
|
||||
<argument index="4" name="index" type="int">
|
||||
</argument>
|
||||
<argument index="5" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<description>
|
||||
Draws single glyph outline of size [code]outline_size[/code] into a canvas item at the position, using [code]font[/code] at the size [code]size[/code]. If outline drawing is not supported, nothing is drawn.
|
||||
Returns advance of the glyph for horizontal and vertical layouts (regardless of outline drawing support).
|
||||
Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_ascent" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="size" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the font ascent (number of pixels above the baseline).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_base_size" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<description>
|
||||
Returns the base size of the font (the only size supported for non-scalable fonts, meaningless for scalable fonts).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_descent" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="size" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the font descent (number of pixels below the baseline).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_glyph_advance" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="size" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns advance of the glyph for horizontal and vertical layouts.
|
||||
Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_glyph_index" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="char" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="variation_selector" type="int" default="0">
|
||||
</argument>
|
||||
<description>
|
||||
Return the glyph index of a [code]char[/code], optionally modified by the [code]variation_selector[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_glyph_kerning" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<argument index="0" name="index_a" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="index_b" type="int">
|
||||
</argument>
|
||||
<argument index="2" name="size" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns a kerning of the pair of glyphs for horizontal and vertical layouts.
|
||||
Note: Glyph index is bound to the font data, use only glyphs indices returned by [method TextServer.shaped_text_get_glyphs] or [method get_glyph_index] for this font data.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_height" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="size" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the total font height (ascent plus descent) in pixels.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_language_support_override" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="language" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if support override is enabled for the [code]language[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_language_support_overrides" qualifiers="const">
|
||||
<return type="PackedStringArray">
|
||||
</return>
|
||||
<description>
|
||||
Returns list of language support overrides.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_script_support_override" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="script" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if support override is enabled for the [code]script[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_script_support_overrides" qualifiers="const">
|
||||
<return type="PackedStringArray">
|
||||
</return>
|
||||
<description>
|
||||
Returns list of script support overrides.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_supported_chars" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
<description>
|
||||
Returns a string containing all the characters available in the font.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_underline_position" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="size" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns underline offset (number of pixels below the baseline).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_underline_thickness" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="size" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns underline thickness in pixels.
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_char" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="char" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Return [code]true[/code] if a Unicode [code]char[/code] is available in the font.
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_outline" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<description>
|
||||
Returns [code]true[/code], if font supports drawing glyph outlines.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_language_supported" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="language" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code).
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_script_supported" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="script" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code], if font supports given script ([url=https://en.wikipedia.org/wiki/ISO_15924]ISO 15924[/url] code).
|
||||
</description>
|
||||
</method>
|
||||
<method name="load_memory">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="data" type="PackedByteArray">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="String">
|
||||
</argument>
|
||||
<argument index="2" name="base_size" type="int" default="16">
|
||||
</argument>
|
||||
<description>
|
||||
Creates new font from the data in memory.
|
||||
Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method get_base_size] to check actual font size.
|
||||
</description>
|
||||
</method>
|
||||
<method name="load_resource">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="filename" type="String">
|
||||
</argument>
|
||||
<argument index="1" name="base_size" type="int" default="16">
|
||||
</argument>
|
||||
<description>
|
||||
Creates new font from the file.
|
||||
Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method get_base_size] to check actual font size.
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_language_support_override">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="language" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Remove language support override.
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_script_support_override">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="script" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Removes script support override.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_language_support_override">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="language" type="String">
|
||||
</argument>
|
||||
<argument index="1" name="supported" type="bool">
|
||||
</argument>
|
||||
<description>
|
||||
Adds override for [method is_language_supported].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_script_support_override">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="script" type="String">
|
||||
</argument>
|
||||
<argument index="1" name="supported" type="bool">
|
||||
</argument>
|
||||
<description>
|
||||
Adds override for [method is_script_supported].
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="antialiased" type="bool" setter="set_antialiased" getter="get_antialiased" default="false">
|
||||
If [code]true[/code], the font is rendered with anti-aliasing.
|
||||
</member>
|
||||
<member name="data_path" type="String" setter="set_data_path" getter="get_data_path" default="""">
|
||||
The path to the font data file. If font data was loaded from memory location is set to [code]"(Memory)"[/code].
|
||||
</member>
|
||||
<member name="distance_field_hint" type="bool" setter="set_distance_field_hint" getter="get_distance_field_hint" default="false">
|
||||
If [code]true[/code], distance field hint is enabled.
|
||||
</member>
|
||||
<member name="force_autohinter" type="bool" setter="set_force_autohinter" getter="get_force_autohinter" default="false">
|
||||
If [code]true[/code], default autohinter is used for font hinting.
|
||||
</member>
|
||||
<member name="hinting" type="int" setter="set_hinting" getter="get_hinting" enum="TextServer.Hinting" default="0">
|
||||
The font hinting mode used by FreeType. See [enum TextServer.Hinting] for options.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
</constants>
|
||||
</class>
|
@ -18,6 +18,13 @@
|
||||
Disables all input and output slots of the GraphNode.
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_opentype_features">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
Removes all OpenType features.
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_slot">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -95,6 +102,15 @@
|
||||
Returns the type of the output connection [code]idx[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_opentype_feature" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="tag" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns OpenType feature [code]tag[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_slot_color_left" qualifiers="const">
|
||||
<return type="Color">
|
||||
</return>
|
||||
@ -149,6 +165,17 @@
|
||||
Returns [code]true[/code] if right (output) slot [code]idx[/code] is enabled, [code]false[/code] otherwise.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_opentype_feature">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="tag" type="String">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_slot">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -184,6 +211,9 @@
|
||||
<member name="comment" type="bool" setter="set_comment" getter="is_comment" default="false">
|
||||
If [code]true[/code], the GraphNode is a comment node.
|
||||
</member>
|
||||
<member name="language" type="String" setter="set_language" getter="get_language" default="""">
|
||||
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
|
||||
</member>
|
||||
<member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" override="true" enum="Control.MouseFilter" default="0" />
|
||||
<member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )">
|
||||
The offset of the GraphNode, relative to the scroll offset of the [GraphEdit].
|
||||
@ -203,6 +233,9 @@
|
||||
If [code]true[/code], the close button will be visible.
|
||||
[b]Note:[/b] Pressing it will only emit the [signal close_request] signal, the GraphNode needs to be removed manually.
|
||||
</member>
|
||||
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
|
||||
Base text writing direction.
|
||||
</member>
|
||||
<member name="title" type="String" setter="set_title" getter="get_title" default="""">
|
||||
The text displayed in the GraphNode's title bar.
|
||||
</member>
|
||||
|
@ -43,6 +43,15 @@
|
||||
Removes all items from the list.
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_item_opentype_features">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Removes all OpenType features from the item's text.
|
||||
</description>
|
||||
</method>
|
||||
<method name="ensure_current_is_visible">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -114,6 +123,15 @@
|
||||
Returns the region of item's icon used. The whole icon will be used if the region has no area.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_item_language" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns item's text language code.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_item_metadata" qualifiers="const">
|
||||
<return type="Variant">
|
||||
</return>
|
||||
@ -123,6 +141,17 @@
|
||||
Returns the metadata value of the specified index.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_item_opentype_feature" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="tag" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns OpenType feature [code]tag[/code] of the item's text.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_item_text" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
@ -132,6 +161,15 @@
|
||||
Returns the text associated with the specified index.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_item_text_direction" qualifiers="const">
|
||||
<return type="int" enum="Control.TextDirection">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns item's text base writing direction.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_item_tooltip" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
@ -336,6 +374,17 @@
|
||||
Sets whether the item icon will be drawn transposed.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_item_language">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="language" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_item_metadata">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -347,6 +396,19 @@
|
||||
Sets a value (of any type) to be stored with the item associated with the specified index.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_item_opentype_feature">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="tag" type="String">
|
||||
</argument>
|
||||
<argument index="2" name="value" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets OpenType feature [code]tag[/code] for the item's text. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_item_selectable">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -369,6 +431,17 @@
|
||||
Sets text of the item associated with the specified index.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_item_text_direction">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="direction" type="int" enum="Control.TextDirection">
|
||||
</argument>
|
||||
<description>
|
||||
Sets item's text base writing direction.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_item_tooltip">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -544,6 +617,9 @@
|
||||
<theme_item name="font_color_selected" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
Text [Color] used when the item is selected.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the item's text.
|
||||
</theme_item>
|
||||
<theme_item name="guide_color" type="Color" default="Color( 0, 0, 0, 0.1 )">
|
||||
[Color] of the guideline. The guideline is a line drawn between each row of items.
|
||||
</theme_item>
|
||||
|
@ -11,6 +11,13 @@
|
||||
<link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="clear_opentype_features">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
Removes all OpenType features.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_count" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
@ -21,8 +28,21 @@
|
||||
<method name="get_line_height" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="line" type="int" default="-1">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the font size in pixels.
|
||||
Returns the height of the line [code]line[/code].
|
||||
If [code]line[/code] is set to [code]-1[/code], returns biggest line height.
|
||||
If there're no lines returns font size in pixels.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_opentype_feature" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="tag" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns OpenType feature [code]tag[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_total_character_count" qualifiers="const">
|
||||
@ -39,6 +59,17 @@
|
||||
Returns the number of lines shown. Useful if the [Label]'s height cannot currently display all lines.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_opentype_feature">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="tag" type="String">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="align" type="int" setter="set_align" getter="get_align" enum="Label.Align" default="0">
|
||||
@ -50,6 +81,9 @@
|
||||
<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. It also lets you scale the node down freely.
|
||||
</member>
|
||||
<member name="language" type="String" setter="set_language" getter="get_language" default="""">
|
||||
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
|
||||
</member>
|
||||
<member name="lines_skipped" type="int" setter="set_lines_skipped" getter="get_lines_skipped" default="0">
|
||||
The node ignores the first [code]lines_skipped[/code] lines before it starts to display text.
|
||||
</member>
|
||||
@ -61,9 +95,18 @@
|
||||
Limits the amount of visible characters. If you set [code]percent_visible[/code] to 0.5, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box.
|
||||
</member>
|
||||
<member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" override="true" default="4" />
|
||||
<member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0">
|
||||
Set BiDi algorithm override for the structured text.
|
||||
</member>
|
||||
<member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[ ]">
|
||||
Set additional options for BiDi override.
|
||||
</member>
|
||||
<member name="text" type="String" setter="set_text" getter="get_text" default="""">
|
||||
The text to display on screen.
|
||||
</member>
|
||||
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
|
||||
Base text writing direction.
|
||||
</member>
|
||||
<member name="uppercase" type="bool" setter="set_uppercase" getter="is_uppercase" default="false">
|
||||
If [code]true[/code], all the text displays as UPPERCASE.
|
||||
</member>
|
||||
@ -85,7 +128,7 @@
|
||||
Align rows to the right.
|
||||
</constant>
|
||||
<constant name="ALIGN_FILL" value="3" enum="Align">
|
||||
Expand row whitespaces to fit the width.
|
||||
Expand row to fit the width.
|
||||
</constant>
|
||||
<constant name="VALIGN_TOP" value="0" enum="VAlign">
|
||||
Align the whole text to the top.
|
||||
@ -113,14 +156,17 @@
|
||||
<theme_item name="font_outline_modulate" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
The tint of [Font]'s outline.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the [Label]'s text.
|
||||
</theme_item>
|
||||
<theme_item name="line_spacing" type="int" default="3">
|
||||
Vertical space between lines in multiline [Label].
|
||||
</theme_item>
|
||||
<theme_item name="normal" type="StyleBox">
|
||||
Background [StyleBox] for the [Label].
|
||||
</theme_item>
|
||||
<theme_item name="shadow_as_outline" type="int" default="0">
|
||||
Boolean value. If set to 1 ([code]true[/code]), the shadow will be displayed around the whole text as an outline.
|
||||
<theme_item name="outline_size" type="int" default="0">
|
||||
Text outline size.
|
||||
</theme_item>
|
||||
<theme_item name="shadow_offset_x" type="int" default="1">
|
||||
The horizontal offset of the text's shadow.
|
||||
@ -128,5 +174,8 @@
|
||||
<theme_item name="shadow_offset_y" type="int" default="1">
|
||||
The vertical offset of the text's shadow.
|
||||
</theme_item>
|
||||
<theme_item name="shadow_outline_size" type="int" default="1">
|
||||
Shadow outline size. If set to 1 or greater, the shadow will be displayed around the whole text as an outline.
|
||||
</theme_item>
|
||||
</theme_items>
|
||||
</class>
|
||||
|
@ -10,6 +10,7 @@
|
||||
- [kbd]Ctrl + X[/kbd]: Cut
|
||||
- [kbd]Ctrl + V[/kbd] or [kbd]Ctrl + Y[/kbd]: Paste/"yank"
|
||||
- [kbd]Ctrl + Z[/kbd]: Undo
|
||||
- [kbd]Ctrl + ~[/kbd]: Swap input direction.
|
||||
- [kbd]Ctrl + Shift + Z[/kbd]: Redo
|
||||
- [kbd]Ctrl + U[/kbd]: Delete text from the cursor position to the beginning of the line
|
||||
- [kbd]Ctrl + K[/kbd]: Delete text from the cursor position to the end of the line
|
||||
@ -46,6 +47,13 @@
|
||||
Erases the [LineEdit]'s [member text].
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_opentype_features">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
Removes all OpenType features.
|
||||
</description>
|
||||
</method>
|
||||
<method name="delete_char_at_cursor">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -78,6 +86,15 @@
|
||||
Returns the [PopupMenu] of this [LineEdit]. By default, this menu is displayed when right-clicking on the [LineEdit].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_opentype_feature" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="tag" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns OpenType feature [code]tag[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_scroll_offset" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
@ -126,6 +143,17 @@
|
||||
Selects the whole [String].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_opentype_feature">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="tag" type="String">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="align" type="int" setter="set_align" getter="get_align" enum="LineEdit.Align" default="0">
|
||||
@ -139,6 +167,10 @@
|
||||
</member>
|
||||
<member name="caret_force_displayed" type="bool" setter="cursor_set_force_displayed" getter="cursor_get_force_displayed" default="false">
|
||||
</member>
|
||||
<member name="caret_mid_grapheme" type="bool" setter="set_mid_grapheme_caret_enabled" getter="get_mid_grapheme_caret_enabled" default="false">
|
||||
Allow moving caret, selecting and removing the individual composite character components.
|
||||
Note: [kbd]Backspace[/kbd] is always removing individual composite character components.
|
||||
</member>
|
||||
<member name="caret_position" type="int" setter="set_cursor_position" getter="get_cursor_position" default="0">
|
||||
The cursor's position inside the [LineEdit]. When set, the text may scroll to accommodate it.
|
||||
</member>
|
||||
@ -148,6 +180,9 @@
|
||||
<member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled" default="true">
|
||||
If [code]true[/code], the context menu will appear when right-clicked.
|
||||
</member>
|
||||
<member name="draw_control_chars" type="bool" setter="set_draw_control_chars" getter="get_draw_control_chars" default="false">
|
||||
If [code]true[/code], control characters are displayed.
|
||||
</member>
|
||||
<member name="editable" type="bool" setter="set_editable" getter="is_editable" default="true">
|
||||
If [code]false[/code], existing text cannot be modified and new text cannot be added.
|
||||
</member>
|
||||
@ -155,6 +190,9 @@
|
||||
If [code]true[/code], the [LineEdit] width will increase to stay longer than the [member text]. It will [b]not[/b] compress if the [member text] is shortened.
|
||||
</member>
|
||||
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" enum="Control.FocusMode" default="2" />
|
||||
<member name="language" type="String" setter="set_language" getter="get_language" default="""">
|
||||
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
|
||||
</member>
|
||||
<member name="max_length" type="int" setter="set_max_length" getter="get_max_length" default="0">
|
||||
Maximum amount of characters that can be entered inside the [LineEdit]. If [code]0[/code], there is no limit.
|
||||
</member>
|
||||
@ -180,10 +218,19 @@
|
||||
<member name="shortcut_keys_enabled" type="bool" setter="set_shortcut_keys_enabled" getter="is_shortcut_keys_enabled" default="true">
|
||||
If [code]false[/code], using shortcuts will be disabled.
|
||||
</member>
|
||||
<member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0">
|
||||
Set BiDi algorithm override for the structured text.
|
||||
</member>
|
||||
<member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[ ]">
|
||||
Set additional options for BiDi override.
|
||||
</member>
|
||||
<member name="text" type="String" setter="set_text" getter="get_text" default="""">
|
||||
String value of the [LineEdit].
|
||||
[b]Note:[/b] Changing text using this property won't emit the [signal text_changed] signal.
|
||||
</member>
|
||||
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
|
||||
Base text writing direction.
|
||||
</member>
|
||||
<member name="virtual_keyboard_enabled" type="bool" setter="set_virtual_keyboard_enabled" getter="is_virtual_keyboard_enabled" default="true">
|
||||
If [code]true[/code], the native virtual keyboard is shown when focused on platforms that support it.
|
||||
</member>
|
||||
@ -220,7 +267,7 @@
|
||||
Aligns the text on the right-hand side of the [LineEdit].
|
||||
</constant>
|
||||
<constant name="ALIGN_FILL" value="3" enum="Align">
|
||||
Stretches whitespaces to fit the [LineEdit]'s width.
|
||||
Expand row to fit the [LineEdit]'s width.
|
||||
</constant>
|
||||
<constant name="MENU_CUT" value="0" enum="MenuItems">
|
||||
Cuts (copies and clears) the selected text.
|
||||
@ -244,7 +291,70 @@
|
||||
<constant name="MENU_REDO" value="6" enum="MenuItems">
|
||||
Reverse the last undo action.
|
||||
</constant>
|
||||
<constant name="MENU_MAX" value="7" enum="MenuItems">
|
||||
<constant name="MENU_DIR_INHERITED" value="7" enum="MenuItems">
|
||||
Sets text direction to inherited.
|
||||
</constant>
|
||||
<constant name="MENU_DIR_AUTO" value="8" enum="MenuItems">
|
||||
Sets text direction to automatic.
|
||||
</constant>
|
||||
<constant name="MENU_DIR_LTR" value="9" enum="MenuItems">
|
||||
Sets text direction to left-to-right.
|
||||
</constant>
|
||||
<constant name="MENU_DIR_RTL" value="10" enum="MenuItems">
|
||||
Sets text direction to right-to-left.
|
||||
</constant>
|
||||
<constant name="MENU_DISPLAY_UCC" value="11" enum="MenuItems">
|
||||
Toggles control character display.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_LRM" value="12" enum="MenuItems">
|
||||
Inserts left-to-right mark (LRM) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_RLM" value="13" enum="MenuItems">
|
||||
Inserts right-to-left mark (RLM) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_LRE" value="14" enum="MenuItems">
|
||||
Inserts start of left-to-right embedding (LRE) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_RLE" value="15" enum="MenuItems">
|
||||
Inserts start of right-to-left embedding (RLE) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_LRO" value="16" enum="MenuItems">
|
||||
Inserts start of left-to-right override (LRO) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_RLO" value="17" enum="MenuItems">
|
||||
Inserts start of right-to-left override (RLO) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_PDF" value="18" enum="MenuItems">
|
||||
Inserts pop direction formatting (PDF) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_ALM" value="19" enum="MenuItems">
|
||||
Inserts Arabic letter mark (ALM) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_LRI" value="20" enum="MenuItems">
|
||||
Inserts left-to-right isolate (LRI) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_RLI" value="21" enum="MenuItems">
|
||||
Inserts right-to-left isolate (RLI) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_FSI" value="22" enum="MenuItems">
|
||||
Inserts first strong isolate (FSI) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_PDI" value="23" enum="MenuItems">
|
||||
Inserts pop direction isolate (PDI) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_ZWJ" value="24" enum="MenuItems">
|
||||
Inserts zero width joiner (ZWJ) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_ZWNJ" value="25" enum="MenuItems">
|
||||
Inserts zero width non-joiner (ZWNJ) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_WJ" value="26" enum="MenuItems">
|
||||
Inserts word joiner (WJ) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_SHY" value="27" enum="MenuItems">
|
||||
Inserts soft hyphen (SHY) character.
|
||||
</constant>
|
||||
<constant name="MENU_MAX" value="28" enum="MenuItems">
|
||||
Represents the size of the [enum MenuItems] enum.
|
||||
</constant>
|
||||
</constants>
|
||||
@ -276,6 +386,9 @@
|
||||
<theme_item name="font_color_uneditable" type="Color" default="Color( 0.88, 0.88, 0.88, 0.5 )">
|
||||
Font color when editing is disabled.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the [LineEdit]'s text.
|
||||
</theme_item>
|
||||
<theme_item name="minimum_spaces" type="int" default="12">
|
||||
Minimum horizontal space for the text (not counting the clear button and content margins). This value is measured in count of space characters (i.e. this amount of space characters can be displayed without scrolling).
|
||||
</theme_item>
|
||||
|
@ -10,12 +10,51 @@
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="clear_opentype_features">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
Removes all OpenType features.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_opentype_feature" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="tag" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns OpenType feature [code]tag[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_opentype_feature">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="tag" type="String">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="language" type="String" setter="set_language" getter="get_language" default="""">
|
||||
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
|
||||
</member>
|
||||
<member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" override="true" enum="Control.CursorShape" default="2" />
|
||||
<member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0">
|
||||
Set BiDi algorithm override for the structured text.
|
||||
</member>
|
||||
<member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[ ]">
|
||||
Set additional options for BiDi override.
|
||||
</member>
|
||||
<member name="text" type="String" setter="set_text" getter="get_text" default="""">
|
||||
The button's text that will be displayed inside the button's area.
|
||||
</member>
|
||||
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
|
||||
Base text writing direction.
|
||||
</member>
|
||||
<member name="underline" type="int" setter="set_underline_mode" getter="get_underline_mode" enum="LinkButton.UnderlineMode" default="0">
|
||||
Determines when to show the underline. See [enum UnderlineMode] for options.
|
||||
</member>
|
||||
@ -47,6 +86,9 @@
|
||||
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
Text [Color] used when the [LinkButton] is being pressed.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the [LinkButton]'s text.
|
||||
</theme_item>
|
||||
<theme_item name="underline_spacing" type="int" default="2">
|
||||
The vertical space between the baseline of text and the underline.
|
||||
</theme_item>
|
||||
|
@ -126,5 +126,8 @@
|
||||
Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application.
|
||||
Implemented on desktop platforms.
|
||||
</constant>
|
||||
<constant name="NOTIFICATION_TEXT_SERVER_CHANGED" value="2018">
|
||||
Notification received when text server is changed.
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
||||
|
@ -67,6 +67,9 @@
|
||||
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
Text [Color] used when the [MenuButton] is being pressed.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the [MenuButton]'s text.
|
||||
</theme_item>
|
||||
<theme_item name="hover" type="StyleBox">
|
||||
[StyleBox] used when the [MenuButton] is being hovered.
|
||||
</theme_item>
|
||||
|
@ -1013,6 +1013,9 @@
|
||||
Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application.
|
||||
Implemented on desktop platforms.
|
||||
</constant>
|
||||
<constant name="NOTIFICATION_TEXT_SERVER_CHANGED" value="2018">
|
||||
Notification received when text server is changed.
|
||||
</constant>
|
||||
<constant name="PAUSE_MODE_INHERIT" value="0" enum="PauseMode">
|
||||
Inherits pause mode from the node's parent. For the root node, it is equivalent to [constant PAUSE_MODE_STOP]. Default.
|
||||
</constant>
|
||||
|
@ -239,7 +239,10 @@
|
||||
The horizontal space between the arrow icon and the right edge of the button.
|
||||
</theme_item>
|
||||
<theme_item name="disabled" type="StyleBox">
|
||||
[StyleBox] used when the [OptionButton] is disabled.
|
||||
[StyleBox] used when the [OptionButton] is disabled (for left-to-right layouts).
|
||||
</theme_item>
|
||||
<theme_item name="disabled_mirrored" type="StyleBox">
|
||||
[StyleBox] used when the [OptionButton] is disabled (for right-to-left layouts).
|
||||
</theme_item>
|
||||
<theme_item name="focus" type="StyleBox">
|
||||
[StyleBox] used when the [OptionButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect.
|
||||
@ -259,17 +262,29 @@
|
||||
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
Text [Color] used when the [OptionButton] is being pressed.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the [OptionButton]'s text.
|
||||
</theme_item>
|
||||
<theme_item name="hover" type="StyleBox">
|
||||
[StyleBox] used when the [OptionButton] is being hovered.
|
||||
[StyleBox] used when the [OptionButton] is being hovered (for left-to-right layouts).
|
||||
</theme_item>
|
||||
<theme_item name="hover_mirrored" type="StyleBox">
|
||||
[StyleBox] used when the [OptionButton] is being hovered (for right-to-left layouts).
|
||||
</theme_item>
|
||||
<theme_item name="hseparation" type="int" default="2">
|
||||
The horizontal space between [OptionButton]'s icon and text.
|
||||
</theme_item>
|
||||
<theme_item name="normal" type="StyleBox">
|
||||
Default [StyleBox] for the [OptionButton].
|
||||
Default [StyleBox] for the [OptionButton] (for left-to-right layouts).
|
||||
</theme_item>
|
||||
<theme_item name="normal_mirrored" type="StyleBox">
|
||||
Default [StyleBox] for the [OptionButton] (for right-to-left layouts).
|
||||
</theme_item>
|
||||
<theme_item name="pressed" type="StyleBox">
|
||||
[StyleBox] used when the [OptionButton] is being pressed.
|
||||
[StyleBox] used when the [OptionButton] is being pressed (for left-to-right layouts).
|
||||
</theme_item>
|
||||
<theme_item name="pressed_mirrored" type="StyleBox">
|
||||
[StyleBox] used when the [OptionButton] is being pressed (for right-to-left layouts).
|
||||
</theme_item>
|
||||
</theme_items>
|
||||
</class>
|
||||
|
@ -244,6 +244,15 @@
|
||||
Removes all items from the [PopupMenu].
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_item_opentype_features">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Removes all OpenType features form the item's text.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_current_index" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
@ -293,6 +302,15 @@
|
||||
Returns the index of the item containing the specified [code]id[/code]. Index is automatically assigned to each item by the engine. Index can not be set manually.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_item_language" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns item's text language code.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_item_metadata" qualifiers="const">
|
||||
<return type="Variant">
|
||||
</return>
|
||||
@ -302,6 +320,17 @@
|
||||
Returns the metadata of the specified item, which might be of any type. You can set it with [method set_item_metadata], which provides a simple way of assigning context data to items.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_item_opentype_feature" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="tag" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns OpenType feature [code]tag[/code] of the item's text.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_item_shortcut" qualifiers="const">
|
||||
<return type="Shortcut">
|
||||
</return>
|
||||
@ -329,6 +358,15 @@
|
||||
Returns the text of the item at index [code]idx[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_item_text_direction" qualifiers="const">
|
||||
<return type="int" enum="Control.TextDirection">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns item's text base writing direction.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_item_tooltip" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
@ -494,6 +532,17 @@
|
||||
Sets the [code]id[/code] of the item at index [code]idx[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_item_language">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="language" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_item_metadata">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -516,6 +565,19 @@
|
||||
Sets the state of an multistate item. See [method add_multistate_item] for details.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_item_opentype_feature">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="tag" type="String">
|
||||
</argument>
|
||||
<argument index="2" name="value" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets OpenType feature [code]tag[/code] for the item's text. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_item_shortcut">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -562,6 +624,17 @@
|
||||
Sets the text of the item at index [code]idx[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_item_text_direction">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="direction" type="int" enum="Control.TextDirection">
|
||||
</argument>
|
||||
<description>
|
||||
Sets item's text base writing direction.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_item_tooltip">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -653,6 +726,9 @@
|
||||
<theme_item name="font_color_hover" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
|
||||
[Color] used for the hovered text.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the menu items.
|
||||
</theme_item>
|
||||
<theme_item name="hover" type="StyleBox">
|
||||
[StyleBox] displayed when the [PopupMenu] item is hovered.
|
||||
</theme_item>
|
||||
@ -681,7 +757,10 @@
|
||||
[StyleBox] used for the separators. See [method add_separator].
|
||||
</theme_item>
|
||||
<theme_item name="submenu" type="Texture2D">
|
||||
[Texture2D] icon for the submenu arrow.
|
||||
[Texture2D] icon for the submenu arrow (for left-to-right layouts).
|
||||
</theme_item>
|
||||
<theme_item name="submenu_mirrored" type="Texture2D">
|
||||
[Texture2D] icon for the submenu arrow (for right-to-left layouts).
|
||||
</theme_item>
|
||||
<theme_item name="unchecked" type="Texture2D">
|
||||
[Texture2D] icon for the unchecked checkbox items.
|
||||
|
@ -35,5 +35,8 @@
|
||||
<theme_item name="font_color_shadow" type="Color" default="Color( 0, 0, 0, 1 )">
|
||||
The color of the text's shadow.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size used to draw the fill percentage if [member percent_visible] is [code]true[/code].
|
||||
</theme_item>
|
||||
</theme_items>
|
||||
</class>
|
||||
|
@ -453,6 +453,9 @@
|
||||
<member name="display/window/energy_saving/keep_screen_on" type="bool" setter="" getter="" default="true">
|
||||
If [code]true[/code], keeps the screen on (even in case of inactivity), so the screensaver does not take over. Works on desktop and mobile platforms.
|
||||
</member>
|
||||
<member name="display/window/force_right_to_left_layout_direction" type="bool" setter="" getter="" default="false">
|
||||
Force layout direction and text writing direction to RTL for all locales.
|
||||
</member>
|
||||
<member name="display/window/handheld/orientation" type="String" setter="" getter="" default=""landscape"">
|
||||
Default orientation on mobile devices.
|
||||
</member>
|
||||
@ -491,6 +494,9 @@
|
||||
<member name="display/window/tablet_driver" type="String" setter="" getter="">
|
||||
Specifies the tablet driver to use. If left empty, the default driver will be used.
|
||||
</member>
|
||||
<member name="display/window/text_name" type="String" setter="" getter="" default="""">
|
||||
Specifies the [TextServer] to use. If left empty, the default will be used.
|
||||
</member>
|
||||
<member name="display/window/vsync/use_vsync" type="bool" setter="" getter="" default="true">
|
||||
If [code]true[/code], enables vertical synchronization. This eliminates tearing that may appear in moving scenes, at the cost of higher input latency and stuttering at lower framerates. If [code]false[/code], vertical synchronization will be disabled, however, many platforms will enforce it regardless (such as mobile platforms and HTML5).
|
||||
</member>
|
||||
|
@ -329,6 +329,9 @@
|
||||
The raw text of the label.
|
||||
When set, clears the tag stack and adds a raw text tag to the top of it. Does not parse BBCodes. Does not modify [member bbcode_text].
|
||||
</member>
|
||||
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
|
||||
Base text writing direction.
|
||||
</member>
|
||||
<member name="visible_characters" type="int" setter="set_visible_characters" getter="get_visible_characters" default="-1">
|
||||
The restricted number of characters to display in the label. If [code]-1[/code], all characters will be displayed.
|
||||
</member>
|
||||
|
@ -204,6 +204,9 @@
|
||||
<theme_item name="font_color_fg" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
|
||||
Font color of the currently selected tab.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the tab names.
|
||||
</theme_item>
|
||||
<theme_item name="icon_separation" type="int" default="4">
|
||||
Space between tab's name and its icon.
|
||||
</theme_item>
|
||||
|
@ -20,6 +20,15 @@
|
||||
Adds a new tab.
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_tab_opentype_features">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="tab_idx" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Removes all OpenType features from the tab title.
|
||||
</description>
|
||||
</method>
|
||||
<method name="ensure_tab_visible">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -75,6 +84,15 @@
|
||||
Returns the [Texture2D] for the tab at index [code]tab_idx[/code] or [code]null[/code] if the tab has no [Texture2D].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_tab_language" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
<argument index="0" name="tab_idx" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns tab title language code.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_tab_offset" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
@ -82,6 +100,17 @@
|
||||
Returns the number of hidden tabs offsetted to the left.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_tab_opentype_feature" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="tab_idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="tag" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns OpenType feature [code]tag[/code] of the tab title.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_tab_rect" qualifiers="const">
|
||||
<return type="Rect2">
|
||||
</return>
|
||||
@ -91,6 +120,15 @@
|
||||
Returns tab [Rect2] with local position and size.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_tab_text_direction" qualifiers="const">
|
||||
<return type="int" enum="Control.TextDirection">
|
||||
</return>
|
||||
<argument index="0" name="tab_idx" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns tab title text base writing direction.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_tab_title" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
@ -159,6 +197,41 @@
|
||||
Sets an [code]icon[/code] for the tab at index [code]tab_idx[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_tab_language">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="tab_idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="language" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Sets language code of tab title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_tab_opentype_feature">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="tab_idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="tag" type="String">
|
||||
</argument>
|
||||
<argument index="2" name="values" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets OpenType feature [code]tag[/code] for the tab title. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_tab_text_direction">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="tab_idx" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="direction" type="int" enum="Control.TextDirection">
|
||||
</argument>
|
||||
<description>
|
||||
Sets tab title base writing direction.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_tab_title">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -295,6 +368,9 @@
|
||||
<theme_item name="font_color_fg" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
|
||||
Font color of the currently selected tab.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the tab names.
|
||||
</theme_item>
|
||||
<theme_item name="hseparation" type="int" default="4">
|
||||
The horizontal separation between the tabs.
|
||||
</theme_item>
|
||||
|
@ -33,6 +33,13 @@
|
||||
Centers the viewport on the line the editing cursor is at. This also resets the [member scroll_horizontal] value to [code]0[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_opentype_features">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
Removes all OpenType features.
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_undo_history">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -213,6 +220,15 @@
|
||||
Returns the [PopupMenu] of this [TextEdit]. By default, this menu is displayed when right-clicking on the [TextEdit].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_opentype_feature" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="tag" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns OpenType feature [code]tag[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_selection_column" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
@ -573,6 +589,17 @@
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_opentype_feature">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="tag" type="String">
|
||||
</argument>
|
||||
<argument index="1" name="value" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_selection_mode">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -629,6 +656,10 @@
|
||||
If [code]true[/code], the caret displays as a rectangle.
|
||||
If [code]false[/code], the caret displays as a bar.
|
||||
</member>
|
||||
<member name="caret_mid_grapheme" type="bool" setter="set_mid_grapheme_caret_enabled" getter="get_mid_grapheme_caret_enabled" default="false">
|
||||
Allow moving caret, selecting and removing the individual composite character components.
|
||||
Note: [kbd]Backspace[/kbd] is always removing individual composite character components.
|
||||
</member>
|
||||
<member name="caret_moving_by_right_click" type="bool" setter="set_right_click_moves_caret" getter="is_right_click_moving_caret" default="true">
|
||||
If [code]true[/code], a right-click moves the cursor at the mouse position before displaying the context menu.
|
||||
If [code]false[/code], the context menu disregards mouse location.
|
||||
@ -636,6 +667,9 @@
|
||||
<member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled" default="true">
|
||||
If [code]true[/code], a right-click displays the context menu.
|
||||
</member>
|
||||
<member name="draw_control_chars" type="bool" setter="set_draw_control_chars" getter="get_draw_control_chars" default="false">
|
||||
If [code]true[/code], control characters are displayed.
|
||||
</member>
|
||||
<member name="draw_spaces" type="bool" setter="set_draw_spaces" getter="is_drawing_spaces" default="false">
|
||||
If [code]true[/code], the "space" character will have a visible representation.
|
||||
</member>
|
||||
@ -652,6 +686,9 @@
|
||||
<member name="highlight_current_line" type="bool" setter="set_highlight_current_line" getter="is_highlight_current_line_enabled" default="false">
|
||||
If [code]true[/code], the line containing the cursor is highlighted.
|
||||
</member>
|
||||
<member name="language" type="String" setter="set_language" getter="get_language" default="""">
|
||||
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
|
||||
</member>
|
||||
<member name="minimap_draw" type="bool" setter="draw_minimap" getter="is_drawing_minimap" default="false">
|
||||
If [code]true[/code], a minimap is shown, providing an outline of your source code.
|
||||
</member>
|
||||
@ -681,11 +718,20 @@
|
||||
<member name="smooth_scrolling" type="bool" setter="set_smooth_scroll_enable" getter="is_smooth_scroll_enabled" default="false">
|
||||
If [code]true[/code], sets the [code]step[/code] of the scrollbars to [code]0.25[/code] which results in smoother scrolling.
|
||||
</member>
|
||||
<member name="structured_text_bidi_override" type="int" setter="set_structured_text_bidi_override" getter="get_structured_text_bidi_override" enum="Control.StructuredTextParser" default="0">
|
||||
Set BiDi algorithm override for the structured text.
|
||||
</member>
|
||||
<member name="structured_text_bidi_override_options" type="Array" setter="set_structured_text_bidi_override_options" getter="get_structured_text_bidi_override_options" default="[ ]">
|
||||
Set additional options for BiDi override.
|
||||
</member>
|
||||
<member name="syntax_highlighter" type="SyntaxHighlighter" setter="set_syntax_highlighter" getter="get_syntax_highlighter">
|
||||
</member>
|
||||
<member name="text" type="String" setter="set_text" getter="get_text" default="""">
|
||||
String value of the [TextEdit].
|
||||
</member>
|
||||
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0">
|
||||
Base text writing direction.
|
||||
</member>
|
||||
<member name="v_scroll_speed" type="float" setter="set_v_scroll_speed" getter="get_v_scroll_speed" default="80.0">
|
||||
Vertical scroll sensitivity.
|
||||
</member>
|
||||
@ -799,7 +845,70 @@
|
||||
<constant name="MENU_REDO" value="6" enum="MenuItems">
|
||||
Redoes the previous action.
|
||||
</constant>
|
||||
<constant name="MENU_MAX" value="7" enum="MenuItems">
|
||||
<constant name="MENU_DIR_INHERITED" value="7" enum="MenuItems">
|
||||
Sets text direction to inherited.
|
||||
</constant>
|
||||
<constant name="MENU_DIR_AUTO" value="8" enum="MenuItems">
|
||||
Sets text direction to automatic.
|
||||
</constant>
|
||||
<constant name="MENU_DIR_LTR" value="9" enum="MenuItems">
|
||||
Sets text direction to left-to-right.
|
||||
</constant>
|
||||
<constant name="MENU_DIR_RTL" value="10" enum="MenuItems">
|
||||
Sets text direction to right-to-left.
|
||||
</constant>
|
||||
<constant name="MENU_DISPLAY_UCC" value="11" enum="MenuItems">
|
||||
Toggles control character display.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_LRM" value="12" enum="MenuItems">
|
||||
Inserts left-to-right mark (LRM) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_RLM" value="13" enum="MenuItems">
|
||||
Inserts right-to-left mark (RLM) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_LRE" value="14" enum="MenuItems">
|
||||
Inserts start of left-to-right embedding (LRE) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_RLE" value="15" enum="MenuItems">
|
||||
Inserts start of right-to-left embedding (RLE) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_LRO" value="16" enum="MenuItems">
|
||||
Inserts start of left-to-right override (LRO) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_RLO" value="17" enum="MenuItems">
|
||||
Inserts start of right-to-left override (RLO) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_PDF" value="18" enum="MenuItems">
|
||||
Inserts pop direction formatting (PDF) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_ALM" value="19" enum="MenuItems">
|
||||
Inserts Arabic letter mark (ALM) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_LRI" value="20" enum="MenuItems">
|
||||
Inserts left-to-right isolate (LRI) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_RLI" value="21" enum="MenuItems">
|
||||
Inserts right-to-left isolate (RLI) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_FSI" value="22" enum="MenuItems">
|
||||
Inserts first strong isolate (FSI) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_PDI" value="23" enum="MenuItems">
|
||||
Inserts pop direction isolate (PDI) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_ZWJ" value="24" enum="MenuItems">
|
||||
Inserts zero width joiner (ZWJ) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_ZWNJ" value="25" enum="MenuItems">
|
||||
Inserts zero width non-joiner (ZWNJ) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_WJ" value="26" enum="MenuItems">
|
||||
Inserts word joiner (WJ) character.
|
||||
</constant>
|
||||
<constant name="MENU_INSERT_SHY" value="27" enum="MenuItems">
|
||||
Inserts soft hyphen (SHY) character.
|
||||
</constant>
|
||||
<constant name="MENU_MAX" value="28" enum="MenuItems">
|
||||
Represents the size of the [enum MenuItems] enum.
|
||||
</constant>
|
||||
</constants>
|
||||
@ -849,6 +958,9 @@
|
||||
<theme_item name="font_color_selected" type="Color" default="Color( 0, 0, 0, 1 )">
|
||||
Sets the [Color] of the selected text. [member override_selected_font_color] has to be enabled.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Sets default font size.
|
||||
</theme_item>
|
||||
<theme_item name="line_spacing" type="int" default="4">
|
||||
Sets the spacing between the lines.
|
||||
</theme_item>
|
||||
@ -865,6 +977,7 @@
|
||||
Sets the highlight [Color] of text selections.
|
||||
</theme_item>
|
||||
<theme_item name="space" type="Texture2D">
|
||||
Sets a custom [Texture2D] for space text characters.
|
||||
</theme_item>
|
||||
<theme_item name="tab" type="Texture2D">
|
||||
Sets a custom [Texture2D] for tab text characters.
|
||||
|
212
doc/classes/TextLine.xml
Normal file
212
doc/classes/TextLine.xml
Normal file
@ -0,0 +1,212 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="TextLine" inherits="Reference" version="4.0">
|
||||
<brief_description>
|
||||
Holds a line of text.
|
||||
</brief_description>
|
||||
<description>
|
||||
Abstraction over [TextServer] for handling single line of text.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="add_object">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="key" type="Variant">
|
||||
</argument>
|
||||
<argument index="1" name="size" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="inline_align" type="int" enum="VAlign" default="1">
|
||||
</argument>
|
||||
<argument index="3" name="length" type="int" default="1">
|
||||
</argument>
|
||||
<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.
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_string">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="text" type="String">
|
||||
</argument>
|
||||
<argument index="1" name="fonts" type="Font">
|
||||
</argument>
|
||||
<argument index="2" name="size" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="opentype_features" type="Dictionary" default="{
|
||||
}">
|
||||
</argument>
|
||||
<argument index="4" name="language" type="String" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Adds text span and font to draw it.
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
Clears text line (removes text and inline objects).
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw" qualifiers="const">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="canvas" type="RID">
|
||||
</argument>
|
||||
<argument index="1" name="pos" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<description>
|
||||
Draw text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_outline" qualifiers="const">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="canvas" type="RID">
|
||||
</argument>
|
||||
<argument index="1" name="pos" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="outline_size" type="int" default="1">
|
||||
</argument>
|
||||
<argument index="3" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<description>
|
||||
Draw text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_ascent" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<description>
|
||||
Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_descent" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<description>
|
||||
Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_underline_position" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<description>
|
||||
Returns pixel offset of the underline below the baseline.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_underline_thickness" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<description>
|
||||
Returns thickness of the underline.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_width" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<description>
|
||||
Returns width (for horizontal layout) or height (for vertical) of the text.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_object_rect" qualifiers="const">
|
||||
<return type="Rect2">
|
||||
</return>
|
||||
<argument index="0" name="key" type="Variant">
|
||||
</argument>
|
||||
<description>
|
||||
Returns bounding rectangle of the inline object.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_objects" qualifiers="const">
|
||||
<return type="Array">
|
||||
</return>
|
||||
<description>
|
||||
Returns array of inline objects.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_rid" qualifiers="const">
|
||||
<return type="RID">
|
||||
</return>
|
||||
<description>
|
||||
Returns TextServer buffer RID.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_size" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<description>
|
||||
Returns size of the bounding box of the text.
|
||||
</description>
|
||||
</method>
|
||||
<method name="hit_test" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="coords" type="float">
|
||||
</argument>
|
||||
<description>
|
||||
Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
|
||||
</description>
|
||||
</method>
|
||||
<method name="resize_object">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="key" type="Variant">
|
||||
</argument>
|
||||
<argument index="1" name="size" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="inline_align" type="int" enum="VAlign" default="1">
|
||||
</argument>
|
||||
<description>
|
||||
Sets new size and alignment of embedded object.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_bidi_override">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="override" type="Array">
|
||||
</argument>
|
||||
<description>
|
||||
Overrides BiDi for the structured text.
|
||||
Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
|
||||
</description>
|
||||
</method>
|
||||
<method name="tab_align">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="tab_stops" type="PackedFloat32Array">
|
||||
</argument>
|
||||
<description>
|
||||
Aligns text to the given tab-stops.
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="align" type="int" setter="set_align" getter="get_align" enum="HAlign" default="0">
|
||||
Text horizontal alignment.
|
||||
</member>
|
||||
<member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0">
|
||||
Text writing direction.
|
||||
</member>
|
||||
<member name="flags" type="int" setter="set_flags" getter="get_flags" default="3">
|
||||
Line Alignment rules. For more info see [TextServer].
|
||||
</member>
|
||||
<member name="orientation" type="int" setter="set_orientation" getter="get_orientation" enum="TextServer.Orientation" default="0">
|
||||
Text orientation.
|
||||
</member>
|
||||
<member name="preserve_control" type="bool" setter="set_preserve_control" getter="get_preserve_control" default="false">
|
||||
If set to [code]true[/code] text will display control characters.
|
||||
</member>
|
||||
<member name="preserve_invalid" type="bool" setter="set_preserve_invalid" getter="get_preserve_invalid" default="true">
|
||||
If set to [code]true[/code] text will display invalid characters.
|
||||
</member>
|
||||
<member name="width" type="float" setter="set_width" getter="get_width" default="-1.0">
|
||||
Text line width.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
</constants>
|
||||
</class>
|
299
doc/classes/TextParagraph.xml
Normal file
299
doc/classes/TextParagraph.xml
Normal file
@ -0,0 +1,299 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="TextParagraph" inherits="Reference" version="4.0">
|
||||
<brief_description>
|
||||
Holds a paragraph of text.
|
||||
</brief_description>
|
||||
<description>
|
||||
Abstraction over [TextServer] for handling paragraph of text.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="add_object">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="key" type="Variant">
|
||||
</argument>
|
||||
<argument index="1" name="size" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="inline_align" type="int" enum="VAlign" default="1">
|
||||
</argument>
|
||||
<argument index="3" name="length" type="int" default="1">
|
||||
</argument>
|
||||
<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.
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_string">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="text" type="String">
|
||||
</argument>
|
||||
<argument index="1" name="fonts" type="Font">
|
||||
</argument>
|
||||
<argument index="2" name="size" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="opentype_features" type="Dictionary" default="{
|
||||
}">
|
||||
</argument>
|
||||
<argument index="4" name="language" type="String" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Adds text span and font to draw it.
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear">
|
||||
<return type="void">
|
||||
</return>
|
||||
<description>
|
||||
Clears text paragraph (removes text and inline objects).
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw" qualifiers="const">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="canvas" type="RID">
|
||||
</argument>
|
||||
<argument index="1" name="pos" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<description>
|
||||
Draw text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_line" qualifiers="const">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="canvas" type="RID">
|
||||
</argument>
|
||||
<argument index="1" name="pos" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="line" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<description>
|
||||
Draw single line of text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_line_outline" qualifiers="const">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="canvas" type="RID">
|
||||
</argument>
|
||||
<argument index="1" name="pos" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="line" type="int">
|
||||
</argument>
|
||||
<argument index="3" name="outline_size" type="int" default="1">
|
||||
</argument>
|
||||
<argument index="4" name="color" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<description>
|
||||
Draw outline of the single line of text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
|
||||
</description>
|
||||
</method>
|
||||
<method name="draw_outline" qualifiers="const">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="canvas" type="RID">
|
||||
</argument>
|
||||
<argument index="1" name="outline_size" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="color" type="int" default="1">
|
||||
</argument>
|
||||
<argument index="3" name="arg3" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
</argument>
|
||||
<description>
|
||||
Draw outline of the text into a canvas item at a given position, with [code]color[/code]. [code]pos[/code] specifies the top left corner of the bounding box.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_ascent" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="line" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the text line ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_count" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
Returns number of lines in the paragraph.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_descent" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="line" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the text line descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_object_rect" qualifiers="const">
|
||||
<return type="Rect2">
|
||||
</return>
|
||||
<argument index="0" name="line" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="key" type="Variant">
|
||||
</argument>
|
||||
<description>
|
||||
Returns bounding rectangle of the inline object.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_objects" qualifiers="const">
|
||||
<return type="Array">
|
||||
</return>
|
||||
<argument index="0" name="line" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns array of inline objects in the line.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_range" qualifiers="const">
|
||||
<return type="Vector2i">
|
||||
</return>
|
||||
<argument index="0" name="line" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns character range of the line.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_rid" qualifiers="const">
|
||||
<return type="RID">
|
||||
</return>
|
||||
<argument index="0" name="line" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns TextServer line buffer RID.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_size" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<argument index="0" name="line" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns size of the bounding box of the line of text.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_underline_position" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="line" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns pixel offset of the underline below the baseline.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_underline_thickness" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="line" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns thickness of the underline.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_line_width" qualifiers="const">
|
||||
<return type="float">
|
||||
</return>
|
||||
<argument index="0" name="line" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns width (for horizontal layout) or height (for vertical) of the line of text.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_non_wraped_size" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<description>
|
||||
Returns the size of the bounding box of the paragraph, without line breaks.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_rid" qualifiers="const">
|
||||
<return type="RID">
|
||||
</return>
|
||||
<description>
|
||||
Returns TextServer full string buffer RID.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_size" qualifiers="const">
|
||||
<return type="Vector2">
|
||||
</return>
|
||||
<description>
|
||||
Returns the size of the bounding box of the paragraph.
|
||||
</description>
|
||||
</method>
|
||||
<method name="hit_test" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="coords" type="Vector2">
|
||||
</argument>
|
||||
<description>
|
||||
Returns caret character offset at the specified coordinates. This function always returns a valid position.
|
||||
</description>
|
||||
</method>
|
||||
<method name="resize_object">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="key" type="Variant">
|
||||
</argument>
|
||||
<argument index="1" name="size" type="Vector2">
|
||||
</argument>
|
||||
<argument index="2" name="inline_align" type="int" enum="VAlign" default="1">
|
||||
</argument>
|
||||
<description>
|
||||
Sets new size and alignment of embedded object.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_bidi_override">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="override" type="Array">
|
||||
</argument>
|
||||
<description>
|
||||
Overrides BiDi for the structured text.
|
||||
Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
|
||||
</description>
|
||||
</method>
|
||||
<method name="tab_align">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="tab_stops" type="PackedFloat32Array">
|
||||
</argument>
|
||||
<description>
|
||||
Aligns paragraph to the given tab-stops.
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="align" type="int" setter="set_align" getter="get_align" enum="HAlign" default="0">
|
||||
Paragraph horizontal alignment.
|
||||
</member>
|
||||
<member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0">
|
||||
Text writing direction.
|
||||
</member>
|
||||
<member name="flags" type="int" setter="set_flags" getter="get_flags" default="51">
|
||||
Line breaking and alignment rules. For more info see [TextServer].
|
||||
</member>
|
||||
<member name="orientation" type="int" setter="set_orientation" getter="get_orientation" enum="TextServer.Orientation" default="0">
|
||||
Text orientation.
|
||||
</member>
|
||||
<member name="preserve_control" type="bool" setter="set_preserve_control" getter="get_preserve_control" default="false">
|
||||
If set to [code]true[/code] text will display control characters.
|
||||
</member>
|
||||
<member name="preserve_invalid" type="bool" setter="set_preserve_invalid" getter="get_preserve_invalid" default="true">
|
||||
If set to [code]true[/code] text will display invalid characters.
|
||||
</member>
|
||||
<member name="width" type="float" setter="set_width" getter="get_width" default="-1.0">
|
||||
Paragraph width.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
</constants>
|
||||
</class>
|
1167
doc/classes/TextServer.xml
Normal file
1167
doc/classes/TextServer.xml
Normal file
File diff suppressed because it is too large
Load Diff
82
doc/classes/TextServerManager.xml
Normal file
82
doc/classes/TextServerManager.xml
Normal file
@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="TextServerManager" inherits="Object" version="4.0">
|
||||
<brief_description>
|
||||
Manager for the font and complex text layout servers.
|
||||
</brief_description>
|
||||
<description>
|
||||
[TextServerManager] is the API backend for loading, enumeration and switching [TextServer]s.
|
||||
Note: Switching text server at runtime is possible, but will invalidate all fonts and text buffers. Make sure to unload all controls, fonts, and themes before doing so.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="find_interface" qualifiers="const">
|
||||
<return type="TextServer">
|
||||
</return>
|
||||
<argument index="0" name="name" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Finds an interface by its name.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_interface" qualifiers="const">
|
||||
<return type="TextServer">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the interface registered at a given index.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_interface_count" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<description>
|
||||
Returns the number of interfaces currently registered.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_interface_features" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns text server supported features (binary OR).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_interface_name" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the interface name registered at a given index.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_interfaces" qualifiers="const">
|
||||
<return type="Array">
|
||||
</return>
|
||||
<description>
|
||||
Returns a list of available interfaces the index and name of each interface.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_primary_interface" qualifiers="const">
|
||||
<return type="TextServer">
|
||||
</return>
|
||||
<description>
|
||||
Returns the primary [TextServer] interface.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_primary_interface">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="index" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets (and initializes it if required) interface registered at a given index as the primary. Invalidates all references to the fonts and text buffers.
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<constants>
|
||||
</constants>
|
||||
</class>
|
@ -51,6 +51,17 @@
|
||||
Clears the [Font] at [code]name[/code] if the theme has [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_font_size">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Clears the font size [code]name[/code] if the theme has [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_icon">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -149,6 +160,26 @@
|
||||
Returns all the [Font]s as a [PackedStringArray] filled with each [Font]'s name, for use in [method get_font], if the theme has [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_font_size" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the font size at [code]name[/code] if the theme has [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_font_size_list" qualifiers="const">
|
||||
<return type="PackedStringArray">
|
||||
</return>
|
||||
<argument index="0" name="node_type" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns all the font sizes as a [PackedStringArray] filled with each font size name, for use in [method get_font_size], if the theme has [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_icon" qualifiers="const">
|
||||
<return type="Texture2D">
|
||||
</return>
|
||||
@ -241,6 +272,18 @@
|
||||
Returns [code]false[/code] if the theme does not have [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_font_size" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if font size with [code]name[/code] is in [code]node_type[/code].
|
||||
Returns [code]false[/code] if the theme does not have [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_icon" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
@ -307,6 +350,20 @@
|
||||
Does nothing if the theme does not have [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_font_size">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="node_type" type="StringName">
|
||||
</argument>
|
||||
<argument index="2" name="font_size" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the theme's font size to [code]font_size[/code] at [code]name[/code] in [code]node_type[/code].
|
||||
Does nothing if the theme does not have [code]node_type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_icon">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -340,6 +397,9 @@
|
||||
<member name="default_font" type="Font" setter="set_default_font" getter="get_default_font">
|
||||
The theme's default font.
|
||||
</member>
|
||||
<member name="default_font_size" type="int" setter="set_default_font_size" getter="get_default_font_size" default="-1">
|
||||
The theme's default font size. Set to [code]-1[/code] to ignore and use global default.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
</constants>
|
||||
|
@ -35,6 +35,15 @@
|
||||
Clears the tree. This removes all items.
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_column_title_opentype_features">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Removes all OpenType features from the item's text.
|
||||
</description>
|
||||
</method>
|
||||
<method name="create_item">
|
||||
<return type="TreeItem">
|
||||
</return>
|
||||
@ -75,6 +84,35 @@
|
||||
Returns the column's title.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_column_title_direction" qualifiers="const">
|
||||
<return type="int" enum="Control.TextDirection">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns column title base writing direction.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_column_title_language" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns column title language code.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_column_title_opentype_feature" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="tag" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns OpenType feature [code]tag[/code] of the column title.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_column_width" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
@ -225,6 +263,41 @@
|
||||
Sets the title of a column.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_column_title_direction">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="direction" type="int" enum="Control.TextDirection">
|
||||
</argument>
|
||||
<description>
|
||||
Sets column title base writing direction.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_column_title_language">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="language" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Sets language code of column title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_column_title_opentype_feature">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="tag" type="String">
|
||||
</argument>
|
||||
<argument index="2" name="value" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets OpenType feature [code]tag[/code] for the column title.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_column_titles_visible">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -398,7 +471,10 @@
|
||||
The arrow icon used when a foldable item is not collapsed.
|
||||
</theme_item>
|
||||
<theme_item name="arrow_collapsed" type="Texture2D">
|
||||
The arrow icon used when a foldable item is collapsed.
|
||||
The arrow icon used when a foldable item is collapsed (for left-to-right layouts).
|
||||
</theme_item>
|
||||
<theme_item name="arrow_collapsed_mirrored" type="Texture2D">
|
||||
The arrow icon used when a foldable item is collapsed (for right-to-left layouts).
|
||||
</theme_item>
|
||||
<theme_item name="bg" type="StyleBox">
|
||||
Default [StyleBox] for the [Tree], i.e. used when the control is not being focused.
|
||||
@ -451,6 +527,9 @@
|
||||
<theme_item name="font_color_selected" type="Color" default="Color( 1, 1, 1, 1 )">
|
||||
Text [Color] used when the item is selected.
|
||||
</theme_item>
|
||||
<theme_item name="font_size" type="int">
|
||||
Font size of the item's text.
|
||||
</theme_item>
|
||||
<theme_item name="guide_color" type="Color" default="Color( 0, 0, 0, 0.1 )">
|
||||
[Color] of the guideline.
|
||||
</theme_item>
|
||||
|
@ -54,6 +54,15 @@
|
||||
Resets the color for the given column to default.
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_opentype_features">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Removes all OpenType features.
|
||||
</description>
|
||||
</method>
|
||||
<method name="deselect">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -184,6 +193,15 @@
|
||||
Returns the icon [Texture2D] region as [Rect2].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_language" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns item's text language code.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_metadata" qualifiers="const">
|
||||
<return type="Variant">
|
||||
</return>
|
||||
@ -209,6 +227,17 @@
|
||||
If [code]wrap[/code] is enabled, the method will wrap around to the first visible element in the tree when called on the last visible element, otherwise it returns [code]null[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_opentype_feature" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="tag" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Returns OpenType feature [code]tag[/code] of the item's text.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_parent">
|
||||
<return type="TreeItem">
|
||||
</return>
|
||||
@ -249,6 +278,22 @@
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_structured_text_bidi_override" qualifiers="const">
|
||||
<return type="int" enum="Control.StructuredTextParser">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_structured_text_bidi_override_options" qualifiers="const">
|
||||
<return type="Array">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_suffix" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
@ -275,6 +320,15 @@
|
||||
Returns the given column's text alignment.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_text_direction" qualifiers="const">
|
||||
<return type="int" enum="Control.TextDirection">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Returns item's text base writing direction.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_tooltip" qualifiers="const">
|
||||
<return type="String">
|
||||
</return>
|
||||
@ -533,6 +587,17 @@
|
||||
Sets the given column's icon's texture region.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_language">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="language" type="String">
|
||||
</argument>
|
||||
<description>
|
||||
Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_metadata">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -543,6 +608,19 @@
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_opentype_feature">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="tag" type="String">
|
||||
</argument>
|
||||
<argument index="2" name="value" type="int">
|
||||
</argument>
|
||||
<description>
|
||||
Sets OpenType feature [code]tag[/code] for the item's text.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_range">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -580,6 +658,26 @@
|
||||
If [code]true[/code], the given column is selectable.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_structured_text_bidi_override">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="parser" type="int" enum="Control.StructuredTextParser">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_structured_text_bidi_override_options">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="args" type="Array">
|
||||
</argument>
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_suffix">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -611,6 +709,17 @@
|
||||
Sets the given column's text alignment. See [enum TextAlign] for possible values.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_text_direction">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="column" type="int">
|
||||
</argument>
|
||||
<argument index="1" name="direction" type="int" enum="Control.TextDirection">
|
||||
</argument>
|
||||
<description>
|
||||
Sets item's text base writing direction.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_tooltip">
|
||||
<return type="void">
|
||||
</return>
|
||||
|
@ -27,6 +27,13 @@
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_layout_direction" qualifiers="const">
|
||||
<return type="int" enum="Window.LayoutDirection">
|
||||
</return>
|
||||
<description>
|
||||
Returns layout direction and text writing direction.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_real_size" qualifiers="const">
|
||||
<return type="Vector2i">
|
||||
</return>
|
||||
@ -61,6 +68,18 @@
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the [Font] at [code]name[/code] if the theme has [code]type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_theme_font_size" qualifiers="const">
|
||||
<return type="int">
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns the font size at [code]name[/code] if the theme has [code]type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_theme_icon" qualifiers="const">
|
||||
@ -123,6 +142,20 @@
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]type[/code].
|
||||
Returns [code]false[/code] if the theme does not have [code]type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_theme_font_size" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<argument index="0" name="name" type="StringName">
|
||||
</argument>
|
||||
<argument index="1" name="type" type="StringName" default="""">
|
||||
</argument>
|
||||
<description>
|
||||
Returns [code]true[/code] if font size with [code]name[/code] is in [code]type[/code].
|
||||
Returns [code]false[/code] if the theme does not have [code]type[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_theme_icon" qualifiers="const">
|
||||
@ -157,6 +190,13 @@
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_layout_rtl" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
<description>
|
||||
Returns [code]true[/code] if layout is right-to-left.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_maximize_allowed" qualifiers="const">
|
||||
<return type="bool">
|
||||
</return>
|
||||
@ -249,6 +289,15 @@
|
||||
<description>
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_layout_direction">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="direction" type="int" enum="Window.LayoutDirection">
|
||||
</argument>
|
||||
<description>
|
||||
Sets layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew).
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_use_font_oversampling">
|
||||
<return type="void">
|
||||
</return>
|
||||
@ -393,6 +442,18 @@
|
||||
</constant>
|
||||
<constant name="CONTENT_SCALE_ASPECT_EXPAND" value="4" enum="ContentScaleAspect">
|
||||
</constant>
|
||||
<constant name="LAYOUT_DIRECTION_INHERITED" value="0" enum="LayoutDirection">
|
||||
Automatic layout direction, determined from the parent control layout direction.
|
||||
</constant>
|
||||
<constant name="LAYOUT_DIRECTION_LOCALE" value="1" enum="LayoutDirection">
|
||||
Automatic layout direction, determined from the current locale.
|
||||
</constant>
|
||||
<constant name="LAYOUT_DIRECTION_LTR" value="2" enum="LayoutDirection">
|
||||
Left-to-right layout direction.
|
||||
</constant>
|
||||
<constant name="LAYOUT_DIRECTION_RTL" value="3" enum="LayoutDirection">
|
||||
Right-to-left layout direction.
|
||||
</constant>
|
||||
</constants>
|
||||
<theme_items>
|
||||
<theme_item name="close" type="Texture2D">
|
||||
|
Loading…
Reference in New Issue
Block a user