mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
classref: Sync with current master branch (f87858a8f)
This commit is contained in:
@@ -14,346 +14,446 @@ TextLine
|
||||
|
||||
Holds a line of text.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Abstraction over :ref:`TextServer<class_TextServer>` for handling single line of text.
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`alignment<class_TextLine_property_alignment>` | ``0`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`Direction<enum_TextServer_Direction>` | :ref:`direction<class_TextLine_property_direction>` | ``0`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`JustificationFlag<enum_TextServer_JustificationFlag>` | :ref:`flags<class_TextLine_property_flags>` | ``3`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`Orientation<enum_TextServer_Orientation>` | :ref:`orientation<class_TextLine_property_orientation>` | ``0`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`preserve_control<class_TextLine_property_preserve_control>` | ``false`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`preserve_invalid<class_TextLine_property_preserve_invalid>` | ``true`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` | :ref:`text_overrun_behavior<class_TextLine_property_text_overrun_behavior>` | ``3`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`float<class_float>` | :ref:`width<class_TextLine_property_width>` | ``-1.0`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`alignment<class_TextLine_property_alignment>` | ``0`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`Direction<enum_TextServer_Direction>` | :ref:`direction<class_TextLine_property_direction>` | ``0`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`JustificationFlag<enum_TextServer_JustificationFlag>` | :ref:`flags<class_TextLine_property_flags>` | ``3`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`Orientation<enum_TextServer_Orientation>` | :ref:`orientation<class_TextLine_property_orientation>` | ``0`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`preserve_control<class_TextLine_property_preserve_control>` | ``false`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`preserve_invalid<class_TextLine_property_preserve_invalid>` | ``true`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` | :ref:`text_overrun_behavior<class_TextLine_property_text_overrun_behavior>` | ``3`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`float<class_float>` | :ref:`width<class_TextLine_property_width>` | ``-1.0`` |
|
||||
+-------------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`add_object<class_TextLine_method_add_object>` **(** :ref:`Variant<class_Variant>` key, :ref:`Vector2<class_Vector2>` size, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=5, :ref:`int<class_int>` length=1 **)** |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`add_string<class_TextLine_method_add_string>` **(** :ref:`String<class_String>` text, :ref:`Font<class_Font>` font, :ref:`int<class_int>` font_size, :ref:`String<class_String>` language="", :ref:`Variant<class_Variant>` meta=null **)** |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`clear<class_TextLine_method_clear>` **(** **)** |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`draw<class_TextLine_method_draw>` **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`draw_outline<class_TextLine_method_draw_outline>` **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` outline_size=1, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_line_ascent<class_TextLine_method_get_line_ascent>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_line_descent<class_TextLine_method_get_line_descent>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_line_underline_position<class_TextLine_method_get_line_underline_position>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_line_underline_thickness<class_TextLine_method_get_line_underline_thickness>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_line_width<class_TextLine_method_get_line_width>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Rect2<class_Rect2>` | :ref:`get_object_rect<class_TextLine_method_get_object_rect>` **(** :ref:`Variant<class_Variant>` key **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`get_objects<class_TextLine_method_get_objects>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`RID<class_RID>` | :ref:`get_rid<class_TextLine_method_get_rid>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`get_size<class_TextLine_method_get_size>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`hit_test<class_TextLine_method_hit_test>` **(** :ref:`float<class_float>` coords **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`resize_object<class_TextLine_method_resize_object>` **(** :ref:`Variant<class_Variant>` key, :ref:`Vector2<class_Vector2>` size, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=5 **)** |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_bidi_override<class_TextLine_method_set_bidi_override>` **(** :ref:`Array<class_Array>` override **)** |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`tab_align<class_TextLine_method_tab_align>` **(** :ref:`PackedFloat32Array<class_PackedFloat32Array>` tab_stops **)** |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`add_object<class_TextLine_method_add_object>` **(** :ref:`Variant<class_Variant>` key, :ref:`Vector2<class_Vector2>` size, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=5, :ref:`int<class_int>` length=1 **)** |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`add_string<class_TextLine_method_add_string>` **(** :ref:`String<class_String>` text, :ref:`Font<class_Font>` font, :ref:`int<class_int>` font_size, :ref:`String<class_String>` language="", :ref:`Variant<class_Variant>` meta=null **)** |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`clear<class_TextLine_method_clear>` **(** **)** |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`draw<class_TextLine_method_draw>` **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`draw_outline<class_TextLine_method_draw_outline>` **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` outline_size=1, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_line_ascent<class_TextLine_method_get_line_ascent>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_line_descent<class_TextLine_method_get_line_descent>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_line_underline_position<class_TextLine_method_get_line_underline_position>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_line_underline_thickness<class_TextLine_method_get_line_underline_thickness>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_line_width<class_TextLine_method_get_line_width>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Rect2<class_Rect2>` | :ref:`get_object_rect<class_TextLine_method_get_object_rect>` **(** :ref:`Variant<class_Variant>` key **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`get_objects<class_TextLine_method_get_objects>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`RID<class_RID>` | :ref:`get_rid<class_TextLine_method_get_rid>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`get_size<class_TextLine_method_get_size>` **(** **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`hit_test<class_TextLine_method_hit_test>` **(** :ref:`float<class_float>` coords **)** |const| |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`resize_object<class_TextLine_method_resize_object>` **(** :ref:`Variant<class_Variant>` key, :ref:`Vector2<class_Vector2>` size, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=5 **)** |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_bidi_override<class_TextLine_method_set_bidi_override>` **(** :ref:`Array<class_Array>` override **)** |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`tab_align<class_TextLine_method_tab_align>` **(** :ref:`PackedFloat32Array<class_PackedFloat32Array>` tab_stops **)** |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_TextLine_property_alignment:
|
||||
|
||||
- :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **alignment**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+---------------------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+---------------------------------+
|
||||
| *Setter* | set_horizontal_alignment(value) |
|
||||
+-----------+---------------------------------+
|
||||
| *Getter* | get_horizontal_alignment() |
|
||||
+-----------+---------------------------------+
|
||||
:ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **alignment** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_horizontal_alignment** **(** :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` value **)**
|
||||
- :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **get_horizontal_alignment** **(** **)**
|
||||
|
||||
Sets text alignment within the line as if the line was horizontal.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_property_direction:
|
||||
|
||||
- :ref:`Direction<enum_TextServer_Direction>` **direction**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+----------------------+
|
||||
| *Setter* | set_direction(value) |
|
||||
+-----------+----------------------+
|
||||
| *Getter* | get_direction() |
|
||||
+-----------+----------------------+
|
||||
:ref:`Direction<enum_TextServer_Direction>` **direction** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_direction** **(** :ref:`Direction<enum_TextServer_Direction>` value **)**
|
||||
- :ref:`Direction<enum_TextServer_Direction>` **get_direction** **(** **)**
|
||||
|
||||
Text writing direction.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_property_flags:
|
||||
|
||||
- :ref:`JustificationFlag<enum_TextServer_JustificationFlag>` **flags**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+------------------+
|
||||
| *Default* | ``3`` |
|
||||
+-----------+------------------+
|
||||
| *Setter* | set_flags(value) |
|
||||
+-----------+------------------+
|
||||
| *Getter* | get_flags() |
|
||||
+-----------+------------------+
|
||||
:ref:`JustificationFlag<enum_TextServer_JustificationFlag>` **flags** = ``3``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_flags** **(** :ref:`JustificationFlag<enum_TextServer_JustificationFlag>` value **)**
|
||||
- :ref:`JustificationFlag<enum_TextServer_JustificationFlag>` **get_flags** **(** **)**
|
||||
|
||||
Line alignment rules. For more info see :ref:`TextServer<class_TextServer>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_property_orientation:
|
||||
|
||||
- :ref:`Orientation<enum_TextServer_Orientation>` **orientation**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+------------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+------------------------+
|
||||
| *Setter* | set_orientation(value) |
|
||||
+-----------+------------------------+
|
||||
| *Getter* | get_orientation() |
|
||||
+-----------+------------------------+
|
||||
:ref:`Orientation<enum_TextServer_Orientation>` **orientation** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_orientation** **(** :ref:`Orientation<enum_TextServer_Orientation>` value **)**
|
||||
- :ref:`Orientation<enum_TextServer_Orientation>` **get_orientation** **(** **)**
|
||||
|
||||
Text orientation.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_property_preserve_control:
|
||||
|
||||
- :ref:`bool<class_bool>` **preserve_control**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-----------------------------+
|
||||
| *Default* | ``false`` |
|
||||
+-----------+-----------------------------+
|
||||
| *Setter* | set_preserve_control(value) |
|
||||
+-----------+-----------------------------+
|
||||
| *Getter* | get_preserve_control() |
|
||||
+-----------+-----------------------------+
|
||||
:ref:`bool<class_bool>` **preserve_control** = ``false``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_preserve_control** **(** :ref:`bool<class_bool>` value **)**
|
||||
- :ref:`bool<class_bool>` **get_preserve_control** **(** **)**
|
||||
|
||||
If set to ``true`` text will display control characters.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_property_preserve_invalid:
|
||||
|
||||
- :ref:`bool<class_bool>` **preserve_invalid**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-----------------------------+
|
||||
| *Default* | ``true`` |
|
||||
+-----------+-----------------------------+
|
||||
| *Setter* | set_preserve_invalid(value) |
|
||||
+-----------+-----------------------------+
|
||||
| *Getter* | get_preserve_invalid() |
|
||||
+-----------+-----------------------------+
|
||||
:ref:`bool<class_bool>` **preserve_invalid** = ``true``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_preserve_invalid** **(** :ref:`bool<class_bool>` value **)**
|
||||
- :ref:`bool<class_bool>` **get_preserve_invalid** **(** **)**
|
||||
|
||||
If set to ``true`` text will display invalid characters.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_property_text_overrun_behavior:
|
||||
|
||||
- :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` **text_overrun_behavior**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------------------+
|
||||
| *Default* | ``3`` |
|
||||
+-----------+----------------------------------+
|
||||
| *Setter* | set_text_overrun_behavior(value) |
|
||||
+-----------+----------------------------------+
|
||||
| *Getter* | get_text_overrun_behavior() |
|
||||
+-----------+----------------------------------+
|
||||
:ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` **text_overrun_behavior** = ``3``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_text_overrun_behavior** **(** :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` value **)**
|
||||
- :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` **get_text_overrun_behavior** **(** **)**
|
||||
|
||||
Sets the clipping behavior when the text exceeds the text line's set width. See :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` for a description of all modes.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_property_width:
|
||||
|
||||
- :ref:`float<class_float>` **width**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+------------------+
|
||||
| *Default* | ``-1.0`` |
|
||||
+-----------+------------------+
|
||||
| *Setter* | set_width(value) |
|
||||
+-----------+------------------+
|
||||
| *Getter* | get_width() |
|
||||
+-----------+------------------+
|
||||
:ref:`float<class_float>` **width** = ``-1.0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_width** **(** :ref:`float<class_float>` value **)**
|
||||
- :ref:`float<class_float>` **get_width** **(** **)**
|
||||
|
||||
Text line width.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_TextLine_method_add_object:
|
||||
|
||||
- :ref:`bool<class_bool>` **add_object** **(** :ref:`Variant<class_Variant>` key, :ref:`Vector2<class_Vector2>` size, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=5, :ref:`int<class_int>` length=1 **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **add_object** **(** :ref:`Variant<class_Variant>` key, :ref:`Vector2<class_Vector2>` size, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=5, :ref:`int<class_int>` length=1 **)**
|
||||
|
||||
Adds inline object to the text buffer, ``key`` must be unique. In the text, object is represented as ``length`` object replacement characters.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_add_string:
|
||||
|
||||
- :ref:`bool<class_bool>` **add_string** **(** :ref:`String<class_String>` text, :ref:`Font<class_Font>` font, :ref:`int<class_int>` font_size, :ref:`String<class_String>` language="", :ref:`Variant<class_Variant>` meta=null **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **add_string** **(** :ref:`String<class_String>` text, :ref:`Font<class_Font>` font, :ref:`int<class_int>` font_size, :ref:`String<class_String>` language="", :ref:`Variant<class_Variant>` meta=null **)**
|
||||
|
||||
Adds text span and font to draw it.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_clear:
|
||||
|
||||
- void **clear** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **clear** **(** **)**
|
||||
|
||||
Clears text line (removes text and inline objects).
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_draw:
|
||||
|
||||
- void **draw** **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **draw** **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const|
|
||||
|
||||
Draw text into a canvas item at a given position, with ``color``. ``pos`` specifies the top left corner of the bounding box.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_draw_outline:
|
||||
|
||||
- void **draw_outline** **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` outline_size=1, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **draw_outline** **(** :ref:`RID<class_RID>` canvas, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` outline_size=1, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1) **)** |const|
|
||||
|
||||
Draw text into a canvas item at a given position, with ``color``. ``pos`` specifies the top left corner of the bounding box.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_get_line_ascent:
|
||||
|
||||
- :ref:`float<class_float>` **get_line_ascent** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **get_line_ascent** **(** **)** |const|
|
||||
|
||||
Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical).
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_get_line_descent:
|
||||
|
||||
- :ref:`float<class_float>` **get_line_descent** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **get_line_descent** **(** **)** |const|
|
||||
|
||||
Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical).
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_get_line_underline_position:
|
||||
|
||||
- :ref:`float<class_float>` **get_line_underline_position** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **get_line_underline_position** **(** **)** |const|
|
||||
|
||||
Returns pixel offset of the underline below the baseline.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_get_line_underline_thickness:
|
||||
|
||||
- :ref:`float<class_float>` **get_line_underline_thickness** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **get_line_underline_thickness** **(** **)** |const|
|
||||
|
||||
Returns thickness of the underline.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_get_line_width:
|
||||
|
||||
- :ref:`float<class_float>` **get_line_width** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **get_line_width** **(** **)** |const|
|
||||
|
||||
Returns width (for horizontal layout) or height (for vertical) of the text.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_get_object_rect:
|
||||
|
||||
- :ref:`Rect2<class_Rect2>` **get_object_rect** **(** :ref:`Variant<class_Variant>` key **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Rect2<class_Rect2>` **get_object_rect** **(** :ref:`Variant<class_Variant>` key **)** |const|
|
||||
|
||||
Returns bounding rectangle of the inline object.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_get_objects:
|
||||
|
||||
- :ref:`Array<class_Array>` **get_objects** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Array<class_Array>` **get_objects** **(** **)** |const|
|
||||
|
||||
Returns array of inline objects.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_get_rid:
|
||||
|
||||
- :ref:`RID<class_RID>` **get_rid** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`RID<class_RID>` **get_rid** **(** **)** |const|
|
||||
|
||||
Returns TextServer buffer RID.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_get_size:
|
||||
|
||||
- :ref:`Vector2<class_Vector2>` **get_size** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Vector2<class_Vector2>` **get_size** **(** **)** |const|
|
||||
|
||||
Returns size of the bounding box of the text.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_hit_test:
|
||||
|
||||
- :ref:`int<class_int>` **hit_test** **(** :ref:`float<class_float>` coords **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`int<class_int>` **hit_test** **(** :ref:`float<class_float>` coords **)** |const|
|
||||
|
||||
Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_resize_object:
|
||||
|
||||
- :ref:`bool<class_bool>` **resize_object** **(** :ref:`Variant<class_Variant>` key, :ref:`Vector2<class_Vector2>` size, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=5 **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **resize_object** **(** :ref:`Variant<class_Variant>` key, :ref:`Vector2<class_Vector2>` size, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=5 **)**
|
||||
|
||||
Sets new size and alignment of embedded object.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_set_bidi_override:
|
||||
|
||||
- void **set_bidi_override** **(** :ref:`Array<class_Array>` override **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_bidi_override** **(** :ref:`Array<class_Array>` override **)**
|
||||
|
||||
Overrides BiDi for the structured text.
|
||||
|
||||
Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_TextLine_method_tab_align:
|
||||
|
||||
- void **tab_align** **(** :ref:`PackedFloat32Array<class_PackedFloat32Array>` tab_stops **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **tab_align** **(** :ref:`PackedFloat32Array<class_PackedFloat32Array>` tab_stops **)**
|
||||
|
||||
Aligns text to the given tab-stops.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user