mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
775 lines
41 KiB
ReStructuredText
775 lines
41 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. meta::
|
||
:keywords: text
|
||
|
||
.. _class_Label:
|
||
|
||
Label
|
||
=====
|
||
|
||
**Hérite de :** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
||
Un contrôle pour afficher du texte brut.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Description
|
||
-----------
|
||
|
||
A control for displaying plain text. It gives you control over the horizontal and vertical alignment and can wrap the text inside the node's bounding rectangle. It doesn't support bold, italics, or other rich text formatting. For that, use :ref:`RichTextLabel<class_RichTextLabel>` instead.
|
||
|
||
\ **Note:** A single Label node is not designed to display huge amounts of text. To display large amounts of text in a single node, consider using :ref:`RichTextLabel<class_RichTextLabel>` instead as it supports features like an integrated scroll bar and threading. :ref:`RichTextLabel<class_RichTextLabel>` generally performs better when displaying large amounts of text (several pages or more).
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Tutoriels
|
||
------------------
|
||
|
||
- `Démo 2D « Dodge The Creeps » <https://godotengine.org/asset-library/asset/2712>`__
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Propriétés
|
||
--------------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` | :ref:`autowrap_mode<class_Label_property_autowrap_mode>` | ``0`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| |bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\] | :ref:`autowrap_trim_flags<class_Label_property_autowrap_trim_flags>` | ``192`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`clip_text<class_Label_property_clip_text>` | ``false`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`ellipsis_char<class_Label_property_ellipsis_char>` | ``"…"`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`horizontal_alignment<class_Label_property_horizontal_alignment>` | ``0`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] | :ref:`justification_flags<class_Label_property_justification_flags>` | ``163`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`LabelSettings<class_LabelSettings>` | :ref:`label_settings<class_Label_property_label_settings>` | |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`language<class_Label_property_language>` | ``""`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`lines_skipped<class_Label_property_lines_skipped>` | ``0`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`max_lines_visible<class_Label_property_max_lines_visible>` | ``-1`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`MouseFilter<enum_Control_MouseFilter>` | mouse_filter | ``2`` (overrides :ref:`Control<class_Control_property_mouse_filter>`) |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`paragraph_separator<class_Label_property_paragraph_separator>` | ``"\\n"`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] | size_flags_vertical | ``4`` (overrides :ref:`Control<class_Control_property_size_flags_vertical>`) |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` | :ref:`structured_text_bidi_override<class_Label_property_structured_text_bidi_override>` | ``0`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`Array<class_Array>` | :ref:`structured_text_bidi_override_options<class_Label_property_structured_text_bidi_override_options>` | ``[]`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`PackedFloat32Array<class_PackedFloat32Array>` | :ref:`tab_stops<class_Label_property_tab_stops>` | ``PackedFloat32Array()`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`text<class_Label_property_text>` | ``""`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`text_direction<class_Label_property_text_direction>` | ``0`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` | :ref:`text_overrun_behavior<class_Label_property_text_overrun_behavior>` | ``0`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`uppercase<class_Label_property_uppercase>` | ``false`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>` | :ref:`vertical_alignment<class_Label_property_vertical_alignment>` | ``0`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`visible_characters<class_Label_property_visible_characters>` | ``-1`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`VisibleCharactersBehavior<enum_TextServer_VisibleCharactersBehavior>` | :ref:`visible_characters_behavior<class_Label_property_visible_characters_behavior>` | ``0`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`visible_ratio<class_Label_property_visible_ratio>` | ``1.0`` |
|
||
+-----------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Méthodes
|
||
----------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+---------------------------+-----------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Rect2<class_Rect2>` | :ref:`get_character_bounds<class_Label_method_get_character_bounds>`\ (\ pos\: :ref:`int<class_int>`\ ) |const| |
|
||
+---------------------------+-----------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_line_count<class_Label_method_get_line_count>`\ (\ ) |const| |
|
||
+---------------------------+-----------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_line_height<class_Label_method_get_line_height>`\ (\ line\: :ref:`int<class_int>` = -1\ ) |const| |
|
||
+---------------------------+-----------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_total_character_count<class_Label_method_get_total_character_count>`\ (\ ) |const| |
|
||
+---------------------------+-----------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_visible_line_count<class_Label_method_get_visible_line_count>`\ (\ ) |const| |
|
||
+---------------------------+-----------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Propriétés du thème
|
||
--------------------------------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+---------------------------------+----------------------------------------------------------------------------+-----------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`font_color<class_Label_theme_color_font_color>` | ``Color(1, 1, 1, 1)`` |
|
||
+---------------------------------+----------------------------------------------------------------------------+-----------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`font_outline_color<class_Label_theme_color_font_outline_color>` | ``Color(0, 0, 0, 1)`` |
|
||
+---------------------------------+----------------------------------------------------------------------------+-----------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`font_shadow_color<class_Label_theme_color_font_shadow_color>` | ``Color(0, 0, 0, 0)`` |
|
||
+---------------------------------+----------------------------------------------------------------------------+-----------------------+
|
||
| :ref:`int<class_int>` | :ref:`line_spacing<class_Label_theme_constant_line_spacing>` | ``3`` |
|
||
+---------------------------------+----------------------------------------------------------------------------+-----------------------+
|
||
| :ref:`int<class_int>` | :ref:`outline_size<class_Label_theme_constant_outline_size>` | ``0`` |
|
||
+---------------------------------+----------------------------------------------------------------------------+-----------------------+
|
||
| :ref:`int<class_int>` | :ref:`paragraph_spacing<class_Label_theme_constant_paragraph_spacing>` | ``0`` |
|
||
+---------------------------------+----------------------------------------------------------------------------+-----------------------+
|
||
| :ref:`int<class_int>` | :ref:`shadow_offset_x<class_Label_theme_constant_shadow_offset_x>` | ``1`` |
|
||
+---------------------------------+----------------------------------------------------------------------------+-----------------------+
|
||
| :ref:`int<class_int>` | :ref:`shadow_offset_y<class_Label_theme_constant_shadow_offset_y>` | ``1`` |
|
||
+---------------------------------+----------------------------------------------------------------------------+-----------------------+
|
||
| :ref:`int<class_int>` | :ref:`shadow_outline_size<class_Label_theme_constant_shadow_outline_size>` | ``1`` |
|
||
+---------------------------------+----------------------------------------------------------------------------+-----------------------+
|
||
| :ref:`Font<class_Font>` | :ref:`font<class_Label_theme_font_font>` | |
|
||
+---------------------------------+----------------------------------------------------------------------------+-----------------------+
|
||
| :ref:`int<class_int>` | :ref:`font_size<class_Label_theme_font_size_font_size>` | |
|
||
+---------------------------------+----------------------------------------------------------------------------+-----------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_Label_theme_style_focus>` | |
|
||
+---------------------------------+----------------------------------------------------------------------------+-----------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_Label_theme_style_normal>` | |
|
||
+---------------------------------+----------------------------------------------------------------------------+-----------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Descriptions des propriétés
|
||
------------------------------------------------------
|
||
|
||
.. _class_Label_property_autowrap_mode:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`AutowrapMode<enum_TextServer_AutowrapMode>` **autowrap_mode** = ``0`` :ref:`🔗<class_Label_property_autowrap_mode>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_autowrap_mode**\ (\ value\: :ref:`AutowrapMode<enum_TextServer_AutowrapMode>`\ )
|
||
- :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` **get_autowrap_mode**\ (\ )
|
||
|
||
Si défini à quelque chose d'autre que :ref:`TextServer.AUTOWRAP_OFF<class_TextServer_constant_AUTOWRAP_OFF>`, le texte retourne automatiquement à la ligne dans le rectangle délimitant du nœud. Si vous redimensionnez le nœud, il va changer sa hauteur automatiquement pour afficher tout le texte.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_autowrap_trim_flags:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
|bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\] **autowrap_trim_flags** = ``192`` :ref:`🔗<class_Label_property_autowrap_trim_flags>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_autowrap_trim_flags**\ (\ value\: |bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\]\ )
|
||
- |bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\] **get_autowrap_trim_flags**\ (\ )
|
||
|
||
Drapeaux de trimming des espaces en autowrap. Voir :ref:`TextServer.BREAK_TRIM_START_EDGE_SPACES<class_TextServer_constant_BREAK_TRIM_START_EDGE_SPACES>` et :ref:`TextServer.BREAK_TRIM_END_EDGE_SPACES<class_TextServer_constant_BREAK_TRIM_END_EDGE_SPACES>` pour plus d'informations.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_clip_text:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **clip_text** = ``false`` :ref:`🔗<class_Label_property_clip_text>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_clip_text**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_clipping_text**\ (\ )
|
||
|
||
Si ``true``, le Label n'affiche que le texte qui rentre à l'intérieur de son rectangle délimitant et coupera le texte horizontalement.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_ellipsis_char:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **ellipsis_char** = ``"…"`` :ref:`🔗<class_Label_property_ellipsis_char>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_ellipsis_char**\ (\ value\: :ref:`String<class_String>`\ )
|
||
- :ref:`String<class_String>` **get_ellipsis_char**\ (\ )
|
||
|
||
Caractère d’ellipse utilisé pour tronquer du texte.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_horizontal_alignment:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **horizontal_alignment** = ``0`` :ref:`🔗<class_Label_property_horizontal_alignment>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_horizontal_alignment**\ (\ value\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>`\ )
|
||
- :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **get_horizontal_alignment**\ (\ )
|
||
|
||
Contrôle l'alignement horizontal du texte. Supporte à gauche, au centre, à droite, ou remplir (aussi connu comme justifié).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_justification_flags:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
|bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] **justification_flags** = ``163`` :ref:`🔗<class_Label_property_justification_flags>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_justification_flags**\ (\ value\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\]\ )
|
||
- |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] **get_justification_flags**\ (\ )
|
||
|
||
Règles d'alignement du remplissage des lignes.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_label_settings:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`LabelSettings<class_LabelSettings>` **label_settings** :ref:`🔗<class_Label_property_label_settings>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_label_settings**\ (\ value\: :ref:`LabelSettings<class_LabelSettings>`\ )
|
||
- :ref:`LabelSettings<class_LabelSettings>` **get_label_settings**\ (\ )
|
||
|
||
Une ressource :ref:`LabelSettings<class_LabelSettings>` qui peut être partagée entre plusieurs nœuds **Label**. Prend la priorité sur les propriétés du thème.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_language:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **language** = ``""`` :ref:`🔗<class_Label_property_language>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_language**\ (\ value\: :ref:`String<class_String>`\ )
|
||
- :ref:`String<class_String>` **get_language**\ (\ )
|
||
|
||
Language code used for line-breaking and text shaping algorithms. If left empty, the current locale is used instead.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_lines_skipped:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`int<class_int>` **lines_skipped** = ``0`` :ref:`🔗<class_Label_property_lines_skipped>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_lines_skipped**\ (\ value\: :ref:`int<class_int>`\ )
|
||
- :ref:`int<class_int>` **get_lines_skipped**\ (\ )
|
||
|
||
Le nombre de lignes ignorées et non affichées depuis le début de la valeur de :ref:`text<class_Label_property_text>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_max_lines_visible:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`int<class_int>` **max_lines_visible** = ``-1`` :ref:`🔗<class_Label_property_max_lines_visible>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_max_lines_visible**\ (\ value\: :ref:`int<class_int>`\ )
|
||
- :ref:`int<class_int>` **get_max_lines_visible**\ (\ )
|
||
|
||
Limite le nombre de lignes de texte que le nœud affiche à l'écran.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_paragraph_separator:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **paragraph_separator** = ``"\\n"`` :ref:`🔗<class_Label_property_paragraph_separator>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_paragraph_separator**\ (\ value\: :ref:`String<class_String>`\ )
|
||
- :ref:`String<class_String>` **get_paragraph_separator**\ (\ )
|
||
|
||
Chaîne utilisée comme séparateur de paragraphe. Chaque paragraphe est traité indépendamment, dans son propre contexte BiDi.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_structured_text_bidi_override:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **structured_text_bidi_override** = ``0`` :ref:`🔗<class_Label_property_structured_text_bidi_override>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_structured_text_bidi_override**\ (\ value\: :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>`\ )
|
||
- :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **get_structured_text_bidi_override**\ (\ )
|
||
|
||
Définit la redéfinition de l'algorithme BiDi pour le texte structuré.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_structured_text_bidi_override_options:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Array<class_Array>` **structured_text_bidi_override_options** = ``[]`` :ref:`🔗<class_Label_property_structured_text_bidi_override_options>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_structured_text_bidi_override_options**\ (\ value\: :ref:`Array<class_Array>`\ )
|
||
- :ref:`Array<class_Array>` **get_structured_text_bidi_override_options**\ (\ )
|
||
|
||
Définit des options supplémentaires pour la redéfinition BiDi.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_tab_stops:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`PackedFloat32Array<class_PackedFloat32Array>` **tab_stops** = ``PackedFloat32Array()`` :ref:`🔗<class_Label_property_tab_stops>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_tab_stops**\ (\ value\: :ref:`PackedFloat32Array<class_PackedFloat32Array>`\ )
|
||
- :ref:`PackedFloat32Array<class_PackedFloat32Array>` **get_tab_stops**\ (\ )
|
||
|
||
Aligns text to the given tab-stops.
|
||
|
||
**Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedFloat32Array<class_PackedFloat32Array>` for more details.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_text:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **text** = ``""`` :ref:`🔗<class_Label_property_text>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_text**\ (\ value\: :ref:`String<class_String>`\ )
|
||
- :ref:`String<class_String>` **get_text**\ (\ )
|
||
|
||
Le texte à afficher à l'écran.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_text_direction:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`TextDirection<enum_Control_TextDirection>` **text_direction** = ``0`` :ref:`🔗<class_Label_property_text_direction>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_text_direction**\ (\ value\: :ref:`TextDirection<enum_Control_TextDirection>`\ )
|
||
- :ref:`TextDirection<enum_Control_TextDirection>` **get_text_direction**\ (\ )
|
||
|
||
Direction d'écriture du texte de base.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_text_overrun_behavior:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` **text_overrun_behavior** = ``0`` :ref:`🔗<class_Label_property_text_overrun_behavior>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_text_overrun_behavior**\ (\ value\: :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>`\ )
|
||
- :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` **get_text_overrun_behavior**\ (\ )
|
||
|
||
Le comportement de coupure lorsque le texte dépasse le rectangle délimitant du nœud.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_uppercase:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **uppercase** = ``false`` :ref:`🔗<class_Label_property_uppercase>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_uppercase**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_uppercase**\ (\ )
|
||
|
||
Si ``true``, tous les textes seront en MAJUSCULE.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_vertical_alignment:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>` **vertical_alignment** = ``0`` :ref:`🔗<class_Label_property_vertical_alignment>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_vertical_alignment**\ (\ value\: :ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>`\ )
|
||
- :ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>` **get_vertical_alignment**\ (\ )
|
||
|
||
Contrôle l'alignement vertical du texte. Supporte en haut, au centre, en bas et remplir.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_visible_characters:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`int<class_int>` **visible_characters** = ``-1`` :ref:`🔗<class_Label_property_visible_characters>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_visible_characters**\ (\ value\: :ref:`int<class_int>`\ )
|
||
- :ref:`int<class_int>` **get_visible_characters**\ (\ )
|
||
|
||
Le nombre de caractères à afficher. Si défini à ``-1``, tous les caractères sont affichés. Cela peut être utile lors de l'animation d'un texte apparaissant dans une boîte de dialogue.
|
||
|
||
\ **Note :** Définir cette propriété met à jour :ref:`visible_ratio<class_Label_property_visible_ratio>` en conséquence.
|
||
|
||
\ **Note :** Les caractères sont comptés comme des codes Unicode. Un seul graphème visible peut contenir plusieurs points de code (par exemple, certains emojis utilisent trois points de code). Un seul point de code peut contenir deux caractères UTF-16, qui sont utilisés dans les chaînes C#.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_visible_characters_behavior:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`VisibleCharactersBehavior<enum_TextServer_VisibleCharactersBehavior>` **visible_characters_behavior** = ``0`` :ref:`🔗<class_Label_property_visible_characters_behavior>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_visible_characters_behavior**\ (\ value\: :ref:`VisibleCharactersBehavior<enum_TextServer_VisibleCharactersBehavior>`\ )
|
||
- :ref:`VisibleCharactersBehavior<enum_TextServer_VisibleCharactersBehavior>` **get_visible_characters_behavior**\ (\ )
|
||
|
||
Le comportement de coupure lorsque :ref:`visible_characters<class_Label_property_visible_characters>` ou :ref:`visible_ratio<class_Label_property_visible_ratio>` est défini.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_property_visible_ratio:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **visible_ratio** = ``1.0`` :ref:`🔗<class_Label_property_visible_ratio>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_visible_ratio**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_visible_ratio**\ (\ )
|
||
|
||
La fraction des caractères à afficher, par rapport au nombre total de caractères (voir :ref:`get_total_character_count()<class_Label_method_get_total_character_count>`). Si défini à ``1.0``, tous les caractères sont affichés. Si défini à ``0.5``, seulement la moitié des caractères seront affichés. Cela peut être utile lors de l'animation du texte apparaissant dans une boîte de dialogue.
|
||
|
||
\ **Note :** Définir cette propriété met à jour :ref:`visible_characters<class_Label_property_visible_characters>` en conséquence.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Descriptions des méthodes
|
||
--------------------------------------------------
|
||
|
||
.. _class_Label_method_get_character_bounds:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Rect2<class_Rect2>` **get_character_bounds**\ (\ pos\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Label_method_get_character_bounds>`
|
||
|
||
Renvoie le rectangle délimitant du caractère en position ``pos`` dans le système de coordonnées local de l'étiquette. Si le caractère est un caractère non-visuel ou ``pos`` est hors de la plage valide, un :ref:`Rect2<class_Rect2>` vide est renvoyé. Si le caractère fait partie d'un graphème composite, le rectangle délimitant de l'ensemble du graphème est renvoyé.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_method_get_line_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_line_count**\ (\ ) |const| :ref:`🔗<class_Label_method_get_line_count>`
|
||
|
||
Renvoie le nombre de lignes de texte qu'a le Label.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_method_get_line_height:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_line_height**\ (\ line\: :ref:`int<class_int>` = -1\ ) |const| :ref:`🔗<class_Label_method_get_line_height>`
|
||
|
||
Renvoie la hauteur de la ligne ``line``.
|
||
|
||
Si ``line`` est définie à ``-1``, renvoie la plus grande hauteur de ligne.
|
||
|
||
S'il n'y a pas de lignes, renvoie la taille de police en pixels.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_method_get_total_character_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_total_character_count**\ (\ ) |const| :ref:`🔗<class_Label_method_get_total_character_count>`
|
||
|
||
Renvoie le nombre total de caractères affichables dans le texte (sauf les espaces et les nouvelles lignes).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_method_get_visible_line_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_visible_line_count**\ (\ ) |const| :ref:`🔗<class_Label_method_get_visible_line_count>`
|
||
|
||
Renvoie le nombre de lignes affichées. Utile si la hauteur du **Label** ne peut pas afficher actuellement toutes les lignes.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Descriptions des propriétés du thème
|
||
------------------------------------------------------------------------
|
||
|
||
.. _class_Label_theme_color_font_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **font_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_Label_theme_color_font_color>`
|
||
|
||
La :ref:`Color<class_Color>` par défaut du texte du **Label**.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_theme_color_font_outline_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **font_outline_color** = ``Color(0, 0, 0, 1)`` :ref:`🔗<class_Label_theme_color_font_outline_color>`
|
||
|
||
La couleur du contour du texte.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_theme_color_font_shadow_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **font_shadow_color** = ``Color(0, 0, 0, 0)`` :ref:`🔗<class_Label_theme_color_font_shadow_color>`
|
||
|
||
La :ref:`Color<class_Color>` de l'ombre du texte.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_theme_constant_line_spacing:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **line_spacing** = ``3`` :ref:`🔗<class_Label_theme_constant_line_spacing>`
|
||
|
||
Espacement vertical supplémentaire entre les lignes (en pixels), l'espacement est ajouté à la descente de la ligne. Cette valeur peut être négative.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_theme_constant_outline_size:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **outline_size** = ``0`` :ref:`🔗<class_Label_theme_constant_outline_size>`
|
||
|
||
Taille du contour du texte.
|
||
|
||
\ **Note :** Si vous utilisez une police avec :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` activé, sa propriété :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` doit être définie à au moins *deux fois* la valeur de :ref:`outline_size<class_Label_theme_constant_outline_size>` pour que le rendu des contours soit correct. Sinon, le contour peut sembler coupé plus tôt que prévu.
|
||
|
||
\ **Note :** L'utilisation d'une valeur supérieure à la moitié de la taille de la police n'est pas recommandée, car le contour de la police peut échouer à être entièrement fermé dans ce cas.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_theme_constant_paragraph_spacing:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **paragraph_spacing** = ``0`` :ref:`🔗<class_Label_theme_constant_paragraph_spacing>`
|
||
|
||
Espace vertical entre les paragraphes. Ajouté en plus de :ref:`line_spacing<class_Label_theme_constant_line_spacing>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_theme_constant_shadow_offset_x:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **shadow_offset_x** = ``1`` :ref:`🔗<class_Label_theme_constant_shadow_offset_x>`
|
||
|
||
Le décalage horizontal de l'ombre du texte.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_theme_constant_shadow_offset_y:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **shadow_offset_y** = ``1`` :ref:`🔗<class_Label_theme_constant_shadow_offset_y>`
|
||
|
||
Le décalage vertical de l'ombre du texte.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_theme_constant_shadow_outline_size:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **shadow_outline_size** = ``1`` :ref:`🔗<class_Label_theme_constant_shadow_outline_size>`
|
||
|
||
La taille du contour d'ombre.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_theme_font_font:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Font<class_Font>` **font** :ref:`🔗<class_Label_theme_font_font>`
|
||
|
||
:ref:`Font<class_Font>` utilisée pour le texte du **Label**.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_theme_font_size_font_size:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **font_size** :ref:`🔗<class_Label_theme_font_size_font_size>`
|
||
|
||
Taille de police du texte de **Label**.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_theme_style_focus:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **focus** :ref:`🔗<class_Label_theme_style_focus>`
|
||
|
||
:ref:`StyleBox<class_StyleBox>` utilisé quand le **Label** a le focus (lorsqu'utilisé avec des applications d’assistance).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Label_theme_style_normal:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **normal** :ref:`🔗<class_Label_theme_style_normal>`
|
||
|
||
Le :ref:`StyleBox<class_StyleBox>` d'arrière-plan pour le **Label**.
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (Cette méthode doit typiquement être redéfinie par l'utilisateur pour avoir un effet.)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (Cette méthode n'a pas d'effets de bord. Elle ne modifie aucune des variables membres de l'instance.)`
|
||
.. |vararg| replace:: :abbr:`vararg (Cette méthode accepte n'importe quel nombre d'arguments après ceux décris ici.)`
|
||
.. |constructor| replace:: :abbr:`constructor (Cette méthode est utilisée pour construire un type.)`
|
||
.. |static| replace:: :abbr:`static (Cette méthode n'a pas besoin d'instance pour être appelée, elle peut donc être directement appelée en utilisant le nom de la classe.)`
|
||
.. |operator| replace:: :abbr:`operator (Cette méthode décrit un opérateur valide à utiliser avec ce type en tant qu'opérande gauche.)`
|
||
.. |bitfield| replace:: :abbr:`BitField (Cette valeur est un nombre entier composé d'un masque de bits des options suivantes.)`
|
||
.. |void| replace:: :abbr:`void (Aucune valeur de retour.)`
|