mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-04 10:09:56 +03:00
2684 lines
221 KiB
ReStructuredText
2684 lines
221 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_RichTextLabel:
|
||
|
||
RichTextLabel
|
||
=============
|
||
|
||
**继承:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
||
用于显示文本的控件,文本中能够包含不同的字体样式、图片以及基础格式。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
描述
|
||
----
|
||
|
||
用于显示文本的控件,文本中能够包含自定义字体、图片以及基础格式。\ **RichTextLabel** 使用内部标签栈管理这些内容。它还可以适应给定的宽度和高度。
|
||
|
||
\ **注意:**\ :ref:`newline()<class_RichTextLabel_method_newline>`\ 、\ :ref:`push_paragraph()<class_RichTextLabel_method_push_paragraph>`\ 、\ ``"\n"``\ 、\ ``"\r\n"``\ 、\ ``p`` 标签以及对齐标签都会开启新的段落。不同段落时独立处理的,使用独立的 BiDi 上下文。如果你想要在段落中强制换行,也可以使用其他换行符,例如 Form Feed(U+000C)、Next Line(U+0085)、Line Separator(U+2028)。
|
||
|
||
\ **注意:**\ 对 :ref:`text<class_RichTextLabel_property_text>` 赋值会将标签栈清空并根据该属性的内容重建。对 :ref:`text<class_RichTextLabel_property_text>` 所做的任何编辑都将擦除之前从 :ref:`append_text()<class_RichTextLabel_method_append_text>` 和 ``push_*`` / :ref:`pop()<class_RichTextLabel_method_pop>` 方法等其他手动来源所做的编辑。
|
||
|
||
\ **注意:**\ RichTextLabel 不支持纠缠的 BBCode 标签。例如,请不要使用 ``[b]加粗[i]加粗斜体[/b]斜体[/i]``\ ,请改为 ``[b]加粗[i]加粗斜体[/i][/b][i]斜体[/i]``\ 。
|
||
|
||
\ **注意:**\ ``push_*/pop`` 函数不会影响 BBCode。
|
||
|
||
\ **注意:**\ 当 :ref:`bbcode_enabled<class_RichTextLabel_property_bbcode_enabled>` 处于启用状态时,\ ``[center]`` 等对齐标签的优先级比 :ref:`horizontal_alignment<class_RichTextLabel_property_horizontal_alignment>` 设置要高,后者设置的是默认文本对齐。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
教程
|
||
----
|
||
|
||
- :doc:`RichTextLabel 中的 BBCode <../tutorials/ui/bbcode_in_richtextlabel>`
|
||
|
||
- `富文本标签 RichTextLabel 的 BBCode 演示 <https://godotengine.org/asset-library/asset/2774>`__
|
||
|
||
- `操作系统测试演示 <https://godotengine.org/asset-library/asset/2789>`__
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
属性
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` | :ref:`autowrap_mode<class_RichTextLabel_property_autowrap_mode>` | ``3`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| |bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\] | :ref:`autowrap_trim_flags<class_RichTextLabel_property_autowrap_trim_flags>` | ``192`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`bbcode_enabled<class_RichTextLabel_property_bbcode_enabled>` | ``false`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | clip_contents | ``true`` (overrides :ref:`Control<class_Control_property_clip_contents>`) |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`context_menu_enabled<class_RichTextLabel_property_context_menu_enabled>` | ``false`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`Array<class_Array>` | :ref:`custom_effects<class_RichTextLabel_property_custom_effects>` | ``[]`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`deselect_on_focus_loss_enabled<class_RichTextLabel_property_deselect_on_focus_loss_enabled>` | ``true`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`drag_and_drop_selection_enabled<class_RichTextLabel_property_drag_and_drop_selection_enabled>` | ``true`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`fit_content<class_RichTextLabel_property_fit_content>` | ``false`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``3`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`hint_underlined<class_RichTextLabel_property_hint_underlined>` | ``true`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`horizontal_alignment<class_RichTextLabel_property_horizontal_alignment>` | ``0`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] | :ref:`justification_flags<class_RichTextLabel_property_justification_flags>` | ``163`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`language<class_RichTextLabel_property_language>` | ``""`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`meta_underlined<class_RichTextLabel_property_meta_underlined>` | ``true`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`progress_bar_delay<class_RichTextLabel_property_progress_bar_delay>` | ``1000`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`scroll_active<class_RichTextLabel_property_scroll_active>` | ``true`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`scroll_following<class_RichTextLabel_property_scroll_following>` | ``false`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`scroll_following_visible_characters<class_RichTextLabel_property_scroll_following_visible_characters>` | ``false`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`selection_enabled<class_RichTextLabel_property_selection_enabled>` | ``false`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`shortcut_keys_enabled<class_RichTextLabel_property_shortcut_keys_enabled>` | ``true`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` | :ref:`structured_text_bidi_override<class_RichTextLabel_property_structured_text_bidi_override>` | ``0`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`Array<class_Array>` | :ref:`structured_text_bidi_override_options<class_RichTextLabel_property_structured_text_bidi_override_options>` | ``[]`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`tab_size<class_RichTextLabel_property_tab_size>` | ``4`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`PackedFloat32Array<class_PackedFloat32Array>` | :ref:`tab_stops<class_RichTextLabel_property_tab_stops>` | ``PackedFloat32Array()`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`text<class_RichTextLabel_property_text>` | ``""`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`text_direction<class_RichTextLabel_property_text_direction>` | ``0`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`threaded<class_RichTextLabel_property_threaded>` | ``false`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>` | :ref:`vertical_alignment<class_RichTextLabel_property_vertical_alignment>` | ``0`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`visible_characters<class_RichTextLabel_property_visible_characters>` | ``-1`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`VisibleCharactersBehavior<enum_TextServer_VisibleCharactersBehavior>` | :ref:`visible_characters_behavior<class_RichTextLabel_property_visible_characters_behavior>` | ``0`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`visible_ratio<class_RichTextLabel_property_visible_ratio>` | ``1.0`` |
|
||
+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
方法
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_hr<class_RichTextLabel_method_add_hr>`\ (\ width\: :ref:`int<class_int>` = 90, height\: :ref:`int<class_int>` = 2, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` = 1, width_in_percent\: :ref:`bool<class_bool>` = true, height_in_percent\: :ref:`bool<class_bool>` = false\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_image<class_RichTextLabel_method_add_image>`\ (\ image\: :ref:`Texture2D<class_Texture2D>`, width\: :ref:`int<class_int>` = 0, height\: :ref:`int<class_int>` = 0, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), inline_align\: :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` = 5, region\: :ref:`Rect2<class_Rect2>` = Rect2(0, 0, 0, 0), key\: :ref:`Variant<class_Variant>` = null, pad\: :ref:`bool<class_bool>` = false, tooltip\: :ref:`String<class_String>` = "", width_in_percent\: :ref:`bool<class_bool>` = false, height_in_percent\: :ref:`bool<class_bool>` = false, alt_text\: :ref:`String<class_String>` = ""\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_text<class_RichTextLabel_method_add_text>`\ (\ text\: :ref:`String<class_String>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`append_text<class_RichTextLabel_method_append_text>`\ (\ bbcode\: :ref:`String<class_String>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear<class_RichTextLabel_method_clear>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`deselect<class_RichTextLabel_method_deselect>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_character_line<class_RichTextLabel_method_get_character_line>`\ (\ character\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_character_paragraph<class_RichTextLabel_method_get_character_paragraph>`\ (\ character\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_content_height<class_RichTextLabel_method_get_content_height>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_content_width<class_RichTextLabel_method_get_content_width>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_line_count<class_RichTextLabel_method_get_line_count>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_line_height<class_RichTextLabel_method_get_line_height>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`get_line_offset<class_RichTextLabel_method_get_line_offset>`\ (\ line\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector2i<class_Vector2i>` | :ref:`get_line_range<class_RichTextLabel_method_get_line_range>`\ (\ line\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_line_width<class_RichTextLabel_method_get_line_width>`\ (\ line\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_RichTextLabel_method_get_menu>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_paragraph_count<class_RichTextLabel_method_get_paragraph_count>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`get_paragraph_offset<class_RichTextLabel_method_get_paragraph_offset>`\ (\ paragraph\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_parsed_text<class_RichTextLabel_method_get_parsed_text>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`get_selected_text<class_RichTextLabel_method_get_selected_text>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_selection_from<class_RichTextLabel_method_get_selection_from>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`get_selection_line_offset<class_RichTextLabel_method_get_selection_line_offset>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_selection_to<class_RichTextLabel_method_get_selection_to>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_total_character_count<class_RichTextLabel_method_get_total_character_count>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`VScrollBar<class_VScrollBar>` | :ref:`get_v_scroll_bar<class_RichTextLabel_method_get_v_scroll_bar>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Rect2i<class_Rect2i>` | :ref:`get_visible_content_rect<class_RichTextLabel_method_get_visible_content_rect>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_visible_line_count<class_RichTextLabel_method_get_visible_line_count>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_visible_paragraph_count<class_RichTextLabel_method_get_visible_paragraph_count>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`install_effect<class_RichTextLabel_method_install_effect>`\ (\ effect\: :ref:`Variant<class_Variant>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`invalidate_paragraph<class_RichTextLabel_method_invalidate_paragraph>`\ (\ paragraph\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_finished<class_RichTextLabel_method_is_finished>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_menu_visible<class_RichTextLabel_method_is_menu_visible>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_ready<class_RichTextLabel_method_is_ready>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`menu_option<class_RichTextLabel_method_menu_option>`\ (\ option\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`newline<class_RichTextLabel_method_newline>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`parse_bbcode<class_RichTextLabel_method_parse_bbcode>`\ (\ bbcode\: :ref:`String<class_String>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Dictionary<class_Dictionary>` | :ref:`parse_expressions_for_values<class_RichTextLabel_method_parse_expressions_for_values>`\ (\ expressions\: :ref:`PackedStringArray<class_PackedStringArray>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`pop<class_RichTextLabel_method_pop>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`pop_all<class_RichTextLabel_method_pop_all>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`pop_context<class_RichTextLabel_method_pop_context>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_bgcolor<class_RichTextLabel_method_push_bgcolor>`\ (\ bgcolor\: :ref:`Color<class_Color>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_bold<class_RichTextLabel_method_push_bold>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_bold_italics<class_RichTextLabel_method_push_bold_italics>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_cell<class_RichTextLabel_method_push_cell>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_color<class_RichTextLabel_method_push_color>`\ (\ color\: :ref:`Color<class_Color>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_context<class_RichTextLabel_method_push_context>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_customfx<class_RichTextLabel_method_push_customfx>`\ (\ effect\: :ref:`RichTextEffect<class_RichTextEffect>`, env\: :ref:`Dictionary<class_Dictionary>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_dropcap<class_RichTextLabel_method_push_dropcap>`\ (\ string\: :ref:`String<class_String>`, font\: :ref:`Font<class_Font>`, size\: :ref:`int<class_int>`, dropcap_margins\: :ref:`Rect2<class_Rect2>` = Rect2(0, 0, 0, 0), color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), outline_size\: :ref:`int<class_int>` = 0, outline_color\: :ref:`Color<class_Color>` = Color(0, 0, 0, 0)\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_fgcolor<class_RichTextLabel_method_push_fgcolor>`\ (\ fgcolor\: :ref:`Color<class_Color>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_font<class_RichTextLabel_method_push_font>`\ (\ font\: :ref:`Font<class_Font>`, font_size\: :ref:`int<class_int>` = 0\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_font_size<class_RichTextLabel_method_push_font_size>`\ (\ font_size\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_hint<class_RichTextLabel_method_push_hint>`\ (\ description\: :ref:`String<class_String>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_indent<class_RichTextLabel_method_push_indent>`\ (\ level\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_italics<class_RichTextLabel_method_push_italics>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_language<class_RichTextLabel_method_push_language>`\ (\ language\: :ref:`String<class_String>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_list<class_RichTextLabel_method_push_list>`\ (\ level\: :ref:`int<class_int>`, type\: :ref:`ListType<enum_RichTextLabel_ListType>`, capitalize\: :ref:`bool<class_bool>`, bullet\: :ref:`String<class_String>` = "•"\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_meta<class_RichTextLabel_method_push_meta>`\ (\ data\: :ref:`Variant<class_Variant>`, underline_mode\: :ref:`MetaUnderline<enum_RichTextLabel_MetaUnderline>` = 1, tooltip\: :ref:`String<class_String>` = ""\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_mono<class_RichTextLabel_method_push_mono>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_normal<class_RichTextLabel_method_push_normal>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_outline_color<class_RichTextLabel_method_push_outline_color>`\ (\ color\: :ref:`Color<class_Color>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_outline_size<class_RichTextLabel_method_push_outline_size>`\ (\ outline_size\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_paragraph<class_RichTextLabel_method_push_paragraph>`\ (\ alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>`, base_direction\: :ref:`TextDirection<enum_Control_TextDirection>` = 0, language\: :ref:`String<class_String>` = "", st_parser\: :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` = 0, justification_flags\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] = 163, tab_stops\: :ref:`PackedFloat32Array<class_PackedFloat32Array>` = PackedFloat32Array()\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_strikethrough<class_RichTextLabel_method_push_strikethrough>`\ (\ color\: :ref:`Color<class_Color>` = Color(0, 0, 0, 0)\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_table<class_RichTextLabel_method_push_table>`\ (\ columns\: :ref:`int<class_int>`, inline_align\: :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` = 0, align_to_row\: :ref:`int<class_int>` = -1, name\: :ref:`String<class_String>` = ""\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`push_underline<class_RichTextLabel_method_push_underline>`\ (\ color\: :ref:`Color<class_Color>` = Color(0, 0, 0, 0)\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`reload_effects<class_RichTextLabel_method_reload_effects>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`remove_paragraph<class_RichTextLabel_method_remove_paragraph>`\ (\ paragraph\: :ref:`int<class_int>`, no_invalidate\: :ref:`bool<class_bool>` = false\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`scroll_to_line<class_RichTextLabel_method_scroll_to_line>`\ (\ line\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`scroll_to_paragraph<class_RichTextLabel_method_scroll_to_paragraph>`\ (\ paragraph\: :ref:`int<class_int>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`scroll_to_selection<class_RichTextLabel_method_scroll_to_selection>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`select_all<class_RichTextLabel_method_select_all>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_cell_border_color<class_RichTextLabel_method_set_cell_border_color>`\ (\ color\: :ref:`Color<class_Color>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_cell_padding<class_RichTextLabel_method_set_cell_padding>`\ (\ padding\: :ref:`Rect2<class_Rect2>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_cell_row_background_color<class_RichTextLabel_method_set_cell_row_background_color>`\ (\ odd_row_bg\: :ref:`Color<class_Color>`, even_row_bg\: :ref:`Color<class_Color>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_cell_size_override<class_RichTextLabel_method_set_cell_size_override>`\ (\ min_size\: :ref:`Vector2<class_Vector2>`, max_size\: :ref:`Vector2<class_Vector2>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_table_column_expand<class_RichTextLabel_method_set_table_column_expand>`\ (\ column\: :ref:`int<class_int>`, expand\: :ref:`bool<class_bool>`, ratio\: :ref:`int<class_int>` = 1, shrink\: :ref:`bool<class_bool>` = true\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_table_column_name<class_RichTextLabel_method_set_table_column_name>`\ (\ column\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`update_image<class_RichTextLabel_method_update_image>`\ (\ key\: :ref:`Variant<class_Variant>`, mask\: |bitfield|\[:ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>`\], image\: :ref:`Texture2D<class_Texture2D>`, width\: :ref:`int<class_int>` = 0, height\: :ref:`int<class_int>` = 0, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), inline_align\: :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` = 5, region\: :ref:`Rect2<class_Rect2>` = Rect2(0, 0, 0, 0), pad\: :ref:`bool<class_bool>` = false, tooltip\: :ref:`String<class_String>` = "", width_in_percent\: :ref:`bool<class_bool>` = false, height_in_percent\: :ref:`bool<class_bool>` = false\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
主题属性
|
||
--------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`default_color<class_RichTextLabel_theme_color_default_color>` | ``Color(1, 1, 1, 1)`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`font_outline_color<class_RichTextLabel_theme_color_font_outline_color>` | ``Color(0, 0, 0, 1)`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`font_selected_color<class_RichTextLabel_theme_color_font_selected_color>` | ``Color(0, 0, 0, 0)`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`font_shadow_color<class_RichTextLabel_theme_color_font_shadow_color>` | ``Color(0, 0, 0, 0)`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`selection_color<class_RichTextLabel_theme_color_selection_color>` | ``Color(0.1, 0.1, 1, 0.8)`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`table_border<class_RichTextLabel_theme_color_table_border>` | ``Color(0, 0, 0, 0)`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`table_even_row_bg<class_RichTextLabel_theme_color_table_even_row_bg>` | ``Color(0, 0, 0, 0)`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`table_odd_row_bg<class_RichTextLabel_theme_color_table_odd_row_bg>` | ``Color(0, 0, 0, 0)`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`line_separation<class_RichTextLabel_theme_constant_line_separation>` | ``0`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`outline_size<class_RichTextLabel_theme_constant_outline_size>` | ``0`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`paragraph_separation<class_RichTextLabel_theme_constant_paragraph_separation>` | ``0`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`shadow_offset_x<class_RichTextLabel_theme_constant_shadow_offset_x>` | ``1`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`shadow_offset_y<class_RichTextLabel_theme_constant_shadow_offset_y>` | ``1`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`shadow_outline_size<class_RichTextLabel_theme_constant_shadow_outline_size>` | ``1`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`strikethrough_alpha<class_RichTextLabel_theme_constant_strikethrough_alpha>` | ``50`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`table_h_separation<class_RichTextLabel_theme_constant_table_h_separation>` | ``3`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`table_v_separation<class_RichTextLabel_theme_constant_table_v_separation>` | ``3`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`text_highlight_h_padding<class_RichTextLabel_theme_constant_text_highlight_h_padding>` | ``3`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`text_highlight_v_padding<class_RichTextLabel_theme_constant_text_highlight_v_padding>` | ``3`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`underline_alpha<class_RichTextLabel_theme_constant_underline_alpha>` | ``50`` |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`Font<class_Font>` | :ref:`bold_font<class_RichTextLabel_theme_font_bold_font>` | |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`Font<class_Font>` | :ref:`bold_italics_font<class_RichTextLabel_theme_font_bold_italics_font>` | |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`Font<class_Font>` | :ref:`italics_font<class_RichTextLabel_theme_font_italics_font>` | |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`Font<class_Font>` | :ref:`mono_font<class_RichTextLabel_theme_font_mono_font>` | |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`Font<class_Font>` | :ref:`normal_font<class_RichTextLabel_theme_font_normal_font>` | |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`bold_font_size<class_RichTextLabel_theme_font_size_bold_font_size>` | |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`bold_italics_font_size<class_RichTextLabel_theme_font_size_bold_italics_font_size>` | |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`italics_font_size<class_RichTextLabel_theme_font_size_italics_font_size>` | |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`mono_font_size<class_RichTextLabel_theme_font_size_mono_font_size>` | |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`int<class_int>` | :ref:`normal_font_size<class_RichTextLabel_theme_font_size_normal_font_size>` | |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`Texture2D<class_Texture2D>` | :ref:`horizontal_rule<class_RichTextLabel_theme_icon_horizontal_rule>` | |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_RichTextLabel_theme_style_focus>` | |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
| :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_RichTextLabel_theme_style_normal>` | |
|
||
+-----------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
信号
|
||
----
|
||
|
||
.. _class_RichTextLabel_signal_finished:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**finished**\ (\ ) :ref:`🔗<class_RichTextLabel_signal_finished>`
|
||
|
||
文档完全加载时触发。
|
||
|
||
\ **注意:**\ 可能发生在文本进行绘制处理之前。发出信号后,滚动值在文档首次绘制前无效。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_signal_meta_clicked:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**meta_clicked**\ (\ meta\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_RichTextLabel_signal_meta_clicked>`
|
||
|
||
用户点击元数据(URL)标签之间的内容时触发。如果 BBCode 中使用类似 ``[url={"key": "value"}]Text[/url]`` 的形式定义了元数据,那么该信号的参数就始终是 :ref:`String<class_String>` 类型。如果需要是特定的类型或者对象,就必须使用 :ref:`push_meta()<class_RichTextLabel_method_push_meta>` 手动向标签栈中插入数据。或者你也可以将输入 :ref:`String<class_String>` 的内容转换到所需的类型(例如调用 :ref:`JSON.parse()<class_JSON_method_parse>`\ )。
|
||
|
||
例如,将下面的方法连接到 :ref:`meta_clicked<class_RichTextLabel_signal_meta_clicked>` 型号可以在点击 URL 时使用用户的默认浏览器打开:
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
# 假设使用信号连接对话框将 RichTextLabel 的 `meta_clicked` 信号
|
||
# 连接到了下面的函数。
|
||
func _richtextlabel_on_meta_clicked(meta):
|
||
# `meta` 是 Variant 类型,所以将其转换为 String,避免运行时脚本出错。
|
||
OS.shell_open(str(meta))
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_signal_meta_hover_ended:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**meta_hover_ended**\ (\ meta\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_RichTextLabel_signal_meta_hover_ended>`
|
||
|
||
当鼠标退出元标签时触发。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_signal_meta_hover_started:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**meta_hover_started**\ (\ meta\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_RichTextLabel_signal_meta_hover_started>`
|
||
|
||
当鼠标进入元标签时触发。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
枚举
|
||
----
|
||
|
||
.. _enum_RichTextLabel_ListType:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **ListType**: :ref:`🔗<enum_RichTextLabel_ListType>`
|
||
|
||
.. _class_RichTextLabel_constant_LIST_NUMBERS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ListType<enum_RichTextLabel_ListType>` **LIST_NUMBERS** = ``0``
|
||
|
||
每个列表项都有数字标记。
|
||
|
||
.. _class_RichTextLabel_constant_LIST_LETTERS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ListType<enum_RichTextLabel_ListType>` **LIST_LETTERS** = ``1``
|
||
|
||
每个列表项都有字母标记。
|
||
|
||
.. _class_RichTextLabel_constant_LIST_ROMAN:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ListType<enum_RichTextLabel_ListType>` **LIST_ROMAN** = ``2``
|
||
|
||
每个列表项都有罗马数字标记。
|
||
|
||
.. _class_RichTextLabel_constant_LIST_DOTS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ListType<enum_RichTextLabel_ListType>` **LIST_DOTS** = ``3``
|
||
|
||
每个列表项都有实心圆标记。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_RichTextLabel_MenuItems:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **MenuItems**: :ref:`🔗<enum_RichTextLabel_MenuItems>`
|
||
|
||
.. _class_RichTextLabel_constant_MENU_COPY:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_RichTextLabel_MenuItems>` **MENU_COPY** = ``0``
|
||
|
||
复制选中的文本。
|
||
|
||
.. _class_RichTextLabel_constant_MENU_SELECT_ALL:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_RichTextLabel_MenuItems>` **MENU_SELECT_ALL** = ``1``
|
||
|
||
全选 :ref:`TextEdit<class_TextEdit>` 文本。
|
||
|
||
.. _class_RichTextLabel_constant_MENU_MAX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MenuItems<enum_RichTextLabel_MenuItems>` **MENU_MAX** = ``2``
|
||
|
||
代表 :ref:`MenuItems<enum_RichTextLabel_MenuItems>` 枚举的大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_RichTextLabel_MetaUnderline:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **MetaUnderline**: :ref:`🔗<enum_RichTextLabel_MetaUnderline>`
|
||
|
||
.. _class_RichTextLabel_constant_META_UNDERLINE_NEVER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MetaUnderline<enum_RichTextLabel_MetaUnderline>` **META_UNDERLINE_NEVER** = ``0``
|
||
|
||
即使 :ref:`meta_underlined<class_RichTextLabel_property_meta_underlined>` 为 ``true``\ ,元标记也不显示下划线。
|
||
|
||
.. _class_RichTextLabel_constant_META_UNDERLINE_ALWAYS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MetaUnderline<enum_RichTextLabel_MetaUnderline>` **META_UNDERLINE_ALWAYS** = ``1``
|
||
|
||
如果 :ref:`meta_underlined<class_RichTextLabel_property_meta_underlined>` 为 ``true``\ ,元数据标签始终会显示下划线。
|
||
|
||
.. _class_RichTextLabel_constant_META_UNDERLINE_ON_HOVER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`MetaUnderline<enum_RichTextLabel_MetaUnderline>` **META_UNDERLINE_ON_HOVER** = ``2``
|
||
|
||
如果 :ref:`meta_underlined<class_RichTextLabel_property_meta_underlined>` 为 ``true``\ ,元数据标签会在鼠标光标悬停时显示下划线。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_RichTextLabel_ImageUpdateMask:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
flags **ImageUpdateMask**: :ref:`🔗<enum_RichTextLabel_ImageUpdateMask>`
|
||
|
||
.. _class_RichTextLabel_constant_UPDATE_TEXTURE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_TEXTURE** = ``1``
|
||
|
||
如果设置了该位,\ :ref:`update_image()<class_RichTextLabel_method_update_image>` 会更改图像纹理。
|
||
|
||
.. _class_RichTextLabel_constant_UPDATE_SIZE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_SIZE** = ``2``
|
||
|
||
如果设置了该位,\ :ref:`update_image()<class_RichTextLabel_method_update_image>` 会更改图像大小。
|
||
|
||
.. _class_RichTextLabel_constant_UPDATE_COLOR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_COLOR** = ``4``
|
||
|
||
如果设置了该位,\ :ref:`update_image()<class_RichTextLabel_method_update_image>` 会更改图像颜色。
|
||
|
||
.. _class_RichTextLabel_constant_UPDATE_ALIGNMENT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_ALIGNMENT** = ``8``
|
||
|
||
如果设置了该位,\ :ref:`update_image()<class_RichTextLabel_method_update_image>` 会更改图像内联对齐方式。
|
||
|
||
.. _class_RichTextLabel_constant_UPDATE_REGION:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_REGION** = ``16``
|
||
|
||
如果设置了该位,\ :ref:`update_image()<class_RichTextLabel_method_update_image>` 会更改图像纹理区块。
|
||
|
||
.. _class_RichTextLabel_constant_UPDATE_PAD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_PAD** = ``32``
|
||
|
||
如果设置了该位,\ :ref:`update_image()<class_RichTextLabel_method_update_image>` 会更改图像填充。
|
||
|
||
.. _class_RichTextLabel_constant_UPDATE_TOOLTIP:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_TOOLTIP** = ``64``
|
||
|
||
如果设置了该位,\ :ref:`update_image()<class_RichTextLabel_method_update_image>` 会更改图像工具提示。
|
||
|
||
.. _class_RichTextLabel_constant_UPDATE_WIDTH_IN_PERCENT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_WIDTH_IN_PERCENT** = ``128``
|
||
|
||
如果设置了该位,\ :ref:`update_image()<class_RichTextLabel_method_update_image>` 会将图像宽度更改自/为百分比。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
属性说明
|
||
--------
|
||
|
||
.. _class_RichTextLabel_property_autowrap_mode:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`AutowrapMode<enum_TextServer_AutowrapMode>` **autowrap_mode** = ``3`` :ref:`🔗<class_RichTextLabel_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**\ (\ )
|
||
|
||
如果设置为 :ref:`TextServer.AUTOWRAP_OFF<class_TextServer_constant_AUTOWRAP_OFF>` 以外的值,则文本将在节点的边界矩形内换行。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_autowrap_trim_flags:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
|bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\] **autowrap_trim_flags** = ``192`` :ref:`🔗<class_RichTextLabel_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**\ (\ )
|
||
|
||
自动换行空格修剪标志。详见 :ref:`TextServer.BREAK_TRIM_START_EDGE_SPACES<class_TextServer_constant_BREAK_TRIM_START_EDGE_SPACES>` 和 :ref:`TextServer.BREAK_TRIM_END_EDGE_SPACES<class_TextServer_constant_BREAK_TRIM_END_EDGE_SPACES>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_bbcode_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **bbcode_enabled** = ``false`` :ref:`🔗<class_RichTextLabel_property_bbcode_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_use_bbcode**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_using_bbcode**\ (\ )
|
||
|
||
如果为 ``true``\ ,则标签使用 BBCode 格式。
|
||
|
||
\ **注意:**\ 只会影响 :ref:`text<class_RichTextLabel_property_text>` 的内容,不会影响标签栈。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_context_menu_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **context_menu_enabled** = ``false`` :ref:`🔗<class_RichTextLabel_property_context_menu_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_context_menu_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_context_menu_enabled**\ (\ )
|
||
|
||
为 ``true`` 时右键单击会显示上下文菜单。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_custom_effects:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Array<class_Array>` **custom_effects** = ``[]`` :ref:`🔗<class_RichTextLabel_property_custom_effects>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_effects**\ (\ value\: :ref:`Array<class_Array>`\ )
|
||
- :ref:`Array<class_Array>` **get_effects**\ (\ )
|
||
|
||
当前配置的自定义效果。这是一个\ :ref:`RichTextEffect<class_RichTextEffect>`\ 的数组。
|
||
|
||
要添加一个自定义效果,使用\ :ref:`install_effect()<class_RichTextLabel_method_install_effect>`\ 会更方便。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_deselect_on_focus_loss_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **deselect_on_focus_loss_enabled** = ``true`` :ref:`🔗<class_RichTextLabel_property_deselect_on_focus_loss_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_deselect_on_focus_loss_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_deselect_on_focus_loss_enabled**\ (\ )
|
||
|
||
如果为 ``true``\ ,则在丢失焦点时会取消选中文本。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_drag_and_drop_selection_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **drag_and_drop_selection_enabled** = ``true`` :ref:`🔗<class_RichTextLabel_property_drag_and_drop_selection_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_drag_and_drop_selection_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_drag_and_drop_selection_enabled**\ (\ )
|
||
|
||
如果为 ``true``\ ,则允许拖放选中的文本。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_fit_content:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **fit_content** = ``false`` :ref:`🔗<class_RichTextLabel_property_fit_content>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_fit_content**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_fit_content_enabled**\ (\ )
|
||
|
||
如果为 ``true``\ ,该标签的最小尺寸会自动更新,适应其内容,与 :ref:`Label<class_Label>` 的行为相匹配。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_hint_underlined:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **hint_underlined** = ``true`` :ref:`🔗<class_RichTextLabel_property_hint_underlined>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_hint_underline**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_hint_underlined**\ (\ )
|
||
|
||
如果为 ``true``\ ,则该标签节点会在 hint 标记下,加下划线,例如 ``[hint=description]{text}[/hint]``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_horizontal_alignment:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **horizontal_alignment** = ``0`` :ref:`🔗<class_RichTextLabel_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**\ (\ )
|
||
|
||
控制文本的水平对齐方式。支持左对齐、居中对齐、右对齐、填充(即两端对齐)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_justification_flags:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
|bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] **justification_flags** = ``163`` :ref:`🔗<class_RichTextLabel_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**\ (\ )
|
||
|
||
行填充对齐规则。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_language:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **language** = ``""`` :ref:`🔗<class_RichTextLabel_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_RichTextLabel_property_meta_underlined:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **meta_underlined** = ``true`` :ref:`🔗<class_RichTextLabel_property_meta_underlined>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_meta_underline**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_meta_underlined**\ (\ )
|
||
|
||
如果为 ``true``\ ,则标签会在元标记下加下划线,例如 ``[url]{text}[/url]``\ 。如果 :ref:`meta_clicked<class_RichTextLabel_signal_meta_clicked>` 被连接到某个函数,则这些标记可以在点击时调用函数。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_progress_bar_delay:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`int<class_int>` **progress_bar_delay** = ``1000`` :ref:`🔗<class_RichTextLabel_property_progress_bar_delay>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_progress_bar_delay**\ (\ value\: :ref:`int<class_int>`\ )
|
||
- :ref:`int<class_int>` **get_progress_bar_delay**\ (\ )
|
||
|
||
加载进度条显示的延迟时间,单位为毫秒。将其设置为 ``-1`` 将完全禁用进度条。
|
||
|
||
\ **注意:**\ 仅当 :ref:`threaded<class_RichTextLabel_property_threaded>` 已启用时才会显示进度条。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_scroll_active:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **scroll_active** = ``true`` :ref:`🔗<class_RichTextLabel_property_scroll_active>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_scroll_active**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_scroll_active**\ (\ )
|
||
|
||
如果为 ``true``\ ,则滚动条可见。将此设置为 ``false`` 不会完全阻止滚动。见\ :ref:`scroll_to_line()<class_RichTextLabel_method_scroll_to_line>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_scroll_following:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **scroll_following** = ``false`` :ref:`🔗<class_RichTextLabel_property_scroll_following>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_scroll_follow**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_scroll_following**\ (\ )
|
||
|
||
如果为 ``true``\ ,则窗口向下滚动以自动显示新内容。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_scroll_following_visible_characters:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **scroll_following_visible_characters** = ``false`` :ref:`🔗<class_RichTextLabel_property_scroll_following_visible_characters>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_scroll_follow_visible_characters**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_scroll_following_visible_characters**\ (\ )
|
||
|
||
如果为 ``true``\ ,则 :ref:`visible_characters<class_RichTextLabel_property_visible_characters>` 或 :ref:`visible_ratio<class_RichTextLabel_property_visible_ratio>` 发生修改时窗口会滚动到能够显示最后一个可见行。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_selection_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **selection_enabled** = ``false`` :ref:`🔗<class_RichTextLabel_property_selection_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_selection_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_selection_enabled**\ (\ )
|
||
|
||
如果为 ``true``\ ,标签允许文本选择。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_shortcut_keys_enabled:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **shortcut_keys_enabled** = ``true`` :ref:`🔗<class_RichTextLabel_property_shortcut_keys_enabled>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_shortcut_keys_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_shortcut_keys_enabled**\ (\ )
|
||
|
||
为 ``true`` 时,即使上下文菜单已被禁用,也会启用该上下文菜单的快捷键。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_structured_text_bidi_override:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **structured_text_bidi_override** = ``0`` :ref:`🔗<class_RichTextLabel_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**\ (\ )
|
||
|
||
为结构化文本设置 BiDi 算法覆盖。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_structured_text_bidi_override_options:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Array<class_Array>` **structured_text_bidi_override_options** = ``[]`` :ref:`🔗<class_RichTextLabel_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**\ (\ )
|
||
|
||
设置 BiDi 覆盖的附加选项。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_tab_size:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`int<class_int>` **tab_size** = ``4`` :ref:`🔗<class_RichTextLabel_property_tab_size>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_tab_size**\ (\ value\: :ref:`int<class_int>`\ )
|
||
- :ref:`int<class_int>` **get_tab_size**\ (\ )
|
||
|
||
与单个制表符长度关联的空格数。不影响文本标签中的 ``\t``\ ,只影响缩进标签。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_tab_stops:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`PackedFloat32Array<class_PackedFloat32Array>` **tab_stops** = ``PackedFloat32Array()`` :ref:`🔗<class_RichTextLabel_property_tab_stops>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_tab_stops**\ (\ value\: :ref:`PackedFloat32Array<class_PackedFloat32Array>`\ )
|
||
- :ref:`PackedFloat32Array<class_PackedFloat32Array>` **get_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_RichTextLabel_property_text:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **text** = ``""`` :ref:`🔗<class_RichTextLabel_property_text>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_text**\ (\ value\: :ref:`String<class_String>`\ )
|
||
- :ref:`String<class_String>` **get_text**\ (\ )
|
||
|
||
该标签的在 BBCode 格式中的文本。不代表对内部标签堆栈的手动修改。编辑时擦除通过其他方法所做的更改。
|
||
|
||
\ **注意:**\ 如果 :ref:`bbcode_enabled<class_RichTextLabel_property_bbcode_enabled>` 为 ``true``\ ,则不建议将 ``+=`` 运算符与 :ref:`text<class_RichTextLabel_property_text>` 一起使用(例如 ``text += "some string"``\ )因为它会替换整个文本并可能导致速度变慢。它还将擦除使用 ``push_*`` 方法添加到堆栈中的所有 BBCode。请改用 :ref:`append_text()<class_RichTextLabel_method_append_text>` 添加文本,除非你绝对需要关闭在之前的方法调用中打开的标签。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_text_direction:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`TextDirection<enum_Control_TextDirection>` **text_direction** = ``0`` :ref:`🔗<class_RichTextLabel_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**\ (\ )
|
||
|
||
基础文本书写方向。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_threaded:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **threaded** = ``false`` :ref:`🔗<class_RichTextLabel_property_threaded>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_threaded**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_threaded**\ (\ )
|
||
|
||
如果为 ``true``\ ,则文本处理在后台线程中完成。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_vertical_alignment:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>` **vertical_alignment** = ``0`` :ref:`🔗<class_RichTextLabel_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**\ (\ )
|
||
|
||
控制文本的垂直对齐方式。支持顶部对齐、居中对齐、底部对齐、填充。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_visible_characters:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`int<class_int>` **visible_characters** = ``-1`` :ref:`🔗<class_RichTextLabel_property_visible_characters>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_visible_characters**\ (\ value\: :ref:`int<class_int>`\ )
|
||
- :ref:`int<class_int>` **get_visible_characters**\ (\ )
|
||
|
||
要显示的字符数。如果设置为 ``-1``\ ,则显示所有字符。这用于在对话框中为显示的文本设置动画。
|
||
|
||
\ **注意:**\ 设置该属性会相应地更新 :ref:`visible_ratio<class_RichTextLabel_property_visible_ratio>`\ 。
|
||
|
||
\ **注意:**\ 字符按照 Unicode 码位计算。一个可见的字素可能包含多个码位(例如部分 Emoji 会使用三个码位)。一个码位可能包含两个 UTF-16 字符,C# 字符串中会用到。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_visible_characters_behavior:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`VisibleCharactersBehavior<enum_TextServer_VisibleCharactersBehavior>` **visible_characters_behavior** = ``0`` :ref:`🔗<class_RichTextLabel_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**\ (\ )
|
||
|
||
设置 :ref:`visible_characters<class_RichTextLabel_property_visible_characters>` 或 :ref:`visible_ratio<class_RichTextLabel_property_visible_ratio>` 被设置时的裁剪行为。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_property_visible_ratio:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **visible_ratio** = ``1.0`` :ref:`🔗<class_RichTextLabel_property_visible_ratio>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_visible_ratio**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_visible_ratio**\ (\ )
|
||
|
||
相对于字符总数(参见 :ref:`get_total_character_count()<class_RichTextLabel_method_get_total_character_count>`\ ),要显示的字符的占比。如果设置为 ``1.0``\ ,则显示所有字符。如果设置为 ``0.5``\ ,则只显示一半的字符。这用于在对话框中为显示的文本设置动画。
|
||
|
||
\ **注意:**\ 设置该属性会相应地更新 :ref:`visible_characters<class_RichTextLabel_property_visible_characters>`\ 。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
方法说明
|
||
--------
|
||
|
||
.. _class_RichTextLabel_method_add_hr:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_hr**\ (\ width\: :ref:`int<class_int>` = 90, height\: :ref:`int<class_int>` = 2, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` = 1, width_in_percent\: :ref:`bool<class_bool>` = true, height_in_percent\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_RichTextLabel_method_add_hr>`
|
||
|
||
添加一条横线,用于分隔内容。
|
||
|
||
如果设置了 ``width_in_percent``\ ,则 ``width`` 的值为控件宽度的百分比,而不是像素。
|
||
|
||
如果设置了 ``height_in_percent``\ ,则 ``height`` 的值为控件高度的百分比,而不是像素。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_add_image:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_image**\ (\ image\: :ref:`Texture2D<class_Texture2D>`, width\: :ref:`int<class_int>` = 0, height\: :ref:`int<class_int>` = 0, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), inline_align\: :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` = 5, region\: :ref:`Rect2<class_Rect2>` = Rect2(0, 0, 0, 0), key\: :ref:`Variant<class_Variant>` = null, pad\: :ref:`bool<class_bool>` = false, tooltip\: :ref:`String<class_String>` = "", width_in_percent\: :ref:`bool<class_bool>` = false, height_in_percent\: :ref:`bool<class_bool>` = false, alt_text\: :ref:`String<class_String>` = ""\ ) :ref:`🔗<class_RichTextLabel_method_add_image>`
|
||
|
||
将图像的开始和结束标签添加到标签栈中,可选择提供 ``width`` 和 ``height`` 来调整图像大小,提供 ``color`` 来给图像混色, ``region`` 只使用图像的一部分。
|
||
|
||
如果 ``width`` 或 ``height`` 被设置为 0,图像的大小将被调整以保持原始长宽比。
|
||
|
||
如果未设置 ``width`` 和 ``height``\ ,但设置了 ``region``\ ,则将使用该区域的矩形。
|
||
|
||
\ ``key`` 是一个可选标识符,可用于通过 :ref:`update_image()<class_RichTextLabel_method_update_image>` 修改图像。
|
||
|
||
如果设置了 ``pad``\ ,并且该图像小于 ``width`` 和 ``height`` 指定的大小,则添加图像填充以匹配大小而不是放大图像。
|
||
|
||
如果设置了 ``width_in_percent``\ ,则 ``width`` 的值为控件宽度的百分比,而不是像素。
|
||
|
||
如果设置了 ``height_in_percent``\ ,则 ``height`` 的值为控件高度的百分比,而不是像素。
|
||
|
||
\ ``alt_text`` 会被用作辅助应用中对图像的描述。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_add_text:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_text**\ (\ text\: :ref:`String<class_String>`\ ) :ref:`🔗<class_RichTextLabel_method_add_text>`
|
||
|
||
将非 BBCode 解析的原始文本添加到标签栈中。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_append_text:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **append_text**\ (\ bbcode\: :ref:`String<class_String>`\ ) :ref:`🔗<class_RichTextLabel_method_append_text>`
|
||
|
||
解析 ``bbcode`` 并根据需要将标签添加到标签栈中。
|
||
|
||
\ **注意:**\ 使用该方法,无法关闭在之前的 :ref:`append_text()<class_RichTextLabel_method_append_text>` 调用中打开的标签。这样做是为了提高性能,尤其是在更新大型 RichTextLabel 时,因为每次都重建整个 BBCode 会比较慢。如果你绝对需要在接下来的方法调用中关闭标签,请追加 :ref:`text<class_RichTextLabel_property_text>` 而不是使用 :ref:`append_text()<class_RichTextLabel_method_append_text>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_clear:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear**\ (\ ) :ref:`🔗<class_RichTextLabel_method_clear>`
|
||
|
||
清除标签栈,导致该标签不显示任何内容。
|
||
|
||
\ **注意:**\ 这个方法不会影响 :ref:`text<class_RichTextLabel_property_text>`\ ,如果重绘标签,其内容会重新显示。但将 :ref:`text<class_RichTextLabel_property_text>` 设置为空 :ref:`String<class_String>` 也会清除栈。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_deselect:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **deselect**\ (\ ) :ref:`🔗<class_RichTextLabel_method_deselect>`
|
||
|
||
清除当前选择。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_character_line:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_character_line**\ (\ character\: :ref:`int<class_int>`\ ) :ref:`🔗<class_RichTextLabel_method_get_character_line>`
|
||
|
||
返回提供的字符位置的行号。行号和字符号都是从零开始索引的。
|
||
|
||
\ **注意:**\ 如果启用了 :ref:`threaded<class_RichTextLabel_property_threaded>`\ ,则该方法返回的是文档已加载部分的值。请使用 :ref:`is_finished()<class_RichTextLabel_method_is_finished>` 或 :ref:`finished<class_RichTextLabel_signal_finished>` 来确定文档是否已完全加载。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_character_paragraph:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_character_paragraph**\ (\ character\: :ref:`int<class_int>`\ ) :ref:`🔗<class_RichTextLabel_method_get_character_paragraph>`
|
||
|
||
返回提供的字符位置的段号。段号和字符号都是从零开始索引的。
|
||
|
||
\ **注意:**\ 如果启用了 :ref:`threaded<class_RichTextLabel_property_threaded>`\ ,则该方法返回的是文档已加载部分的值。请使用 :ref:`is_finished()<class_RichTextLabel_method_is_finished>` 或 :ref:`finished<class_RichTextLabel_signal_finished>` 来确定文档是否已完全加载。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_content_height:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_content_height**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_content_height>`
|
||
|
||
返回内容的高度。
|
||
|
||
\ **注意:**\ 该方法始终返回完整的内容大小,不受 :ref:`visible_ratio<class_RichTextLabel_property_visible_ratio>` 和 :ref:`visible_characters<class_RichTextLabel_property_visible_characters>` 的影响。获取可见内容的大小请使用 :ref:`get_visible_content_rect()<class_RichTextLabel_method_get_visible_content_rect>`\ 。
|
||
|
||
\ **注意:**\ 如果启用了 :ref:`threaded<class_RichTextLabel_property_threaded>`\ ,则该方法返回文档已加载部分的值。请使用 :ref:`is_finished()<class_RichTextLabel_method_is_finished>` 或 :ref:`finished<class_RichTextLabel_signal_finished>` 来确定文档是否已完全加载。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_content_width:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_content_width**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_content_width>`
|
||
|
||
返回内容的宽度。
|
||
|
||
\ **注意:**\ 该方法始终返回完整的内容大小,不受 :ref:`visible_ratio<class_RichTextLabel_property_visible_ratio>` 和 :ref:`visible_characters<class_RichTextLabel_property_visible_characters>` 的影响。获取可见内容的大小请使用 :ref:`get_visible_content_rect()<class_RichTextLabel_method_get_visible_content_rect>`\ 。
|
||
|
||
\ **注意:**\ 如果启用了 :ref:`threaded<class_RichTextLabel_property_threaded>`\ ,则该方法返回文档已加载部分的值。请使用 :ref:`is_finished()<class_RichTextLabel_method_is_finished>` 或 :ref:`finished<class_RichTextLabel_signal_finished>` 来确定文档是否已完全加载。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_line_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_line_count**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_line_count>`
|
||
|
||
返回文本中的总行数。自动换行的文本算作多行。
|
||
|
||
\ **注意:**\ 如果启用了 :ref:`threaded<class_RichTextLabel_property_threaded>`\ ,则该方法返回的是文档已加载部分的值。请使用 :ref:`is_finished()<class_RichTextLabel_method_is_finished>` 或 :ref:`finished<class_RichTextLabel_signal_finished>` 来确定文档是否已完全加载。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_line_height:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_line_height**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_line_height>`
|
||
|
||
返回位于提供的索引处的行的高度。
|
||
|
||
\ **注意:**\ 如果启用了 :ref:`threaded<class_RichTextLabel_property_threaded>`\ ,则该方法返回的是文档已加载部分的值。请使用 :ref:`is_finished()<class_RichTextLabel_method_is_finished>` 或 :ref:`finished<class_RichTextLabel_signal_finished>` 来确定文档是否已完全加载。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_line_offset:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **get_line_offset**\ (\ line\: :ref:`int<class_int>`\ ) :ref:`🔗<class_RichTextLabel_method_get_line_offset>`
|
||
|
||
返回位于提供的索引处的行的垂直偏移量。
|
||
|
||
\ **注意:**\ 如果启用了 :ref:`threaded<class_RichTextLabel_property_threaded>`\ ,则该方法返回的是文档已加载部分的值。请使用 :ref:`is_finished()<class_RichTextLabel_method_is_finished>` 或 :ref:`finished<class_RichTextLabel_signal_finished>` 来确定文档是否已完全加载。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_line_range:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector2i<class_Vector2i>` **get_line_range**\ (\ line\: :ref:`int<class_int>`\ ) :ref:`🔗<class_RichTextLabel_method_get_line_range>`
|
||
|
||
返回 ``line`` 行上第一个和最后一个可见字符的索引,形式为 :ref:`Vector2i<class_Vector2i>`\ 。
|
||
|
||
\ **注意:**\ 如果将 :ref:`visible_characters_behavior<class_RichTextLabel_property_visible_characters_behavior>` 设为 :ref:`TextServer.VC_CHARS_BEFORE_SHAPING<class_TextServer_constant_VC_CHARS_BEFORE_SHAPING>`\ ,则只会计算可见的换行。
|
||
|
||
\ **注意:**\ 如果启用了 :ref:`threaded<class_RichTextLabel_property_threaded>`\ ,则该方法返回的是文档已加载部分的值。请使用 :ref:`is_finished()<class_RichTextLabel_method_is_finished>` 或 :ref:`finished<class_RichTextLabel_signal_finished>` 来确定文档是否已完全加载。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_line_width:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_line_width**\ (\ line\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_line_width>`
|
||
|
||
返回位于提供的索引处的行的宽度。
|
||
|
||
\ **注意:**\ 如果启用了 :ref:`threaded<class_RichTextLabel_property_threaded>`\ ,则该方法返回的是文档已加载部分的值。请使用 :ref:`is_finished()<class_RichTextLabel_method_is_finished>` 或 :ref:`finished<class_RichTextLabel_signal_finished>` 来确定文档是否已完全加载。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_menu:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PopupMenu<class_PopupMenu>` **get_menu**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_menu>`
|
||
|
||
返回该 **RichTextLabel** 的 :ref:`PopupMenu<class_PopupMenu>`\ 。默认情况下,这个菜单会在右键单击 **RichTextLabel** 时显示。
|
||
|
||
你可以加入自定义的菜单项,或者移除标准菜单项。请确保你的 ID 与标准 ID 不冲突(见 :ref:`MenuItems<enum_RichTextLabel_MenuItems>`\ )。例如:
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
func _ready():
|
||
var menu = get_menu()
|
||
# 移除“全选”菜单项。
|
||
menu.remove_item(MENU_SELECT_ALL)
|
||
# 添加自定义菜单项。
|
||
menu.add_separator()
|
||
menu.add_item("制作文本副本", MENU_MAX + 1)
|
||
# 连接回调。
|
||
menu.id_pressed.connect(_on_item_pressed)
|
||
|
||
func _on_item_pressed(id):
|
||
if id == MENU_MAX + 1:
|
||
add_text("\n" + get_parsed_text())
|
||
|
||
.. code-tab:: csharp
|
||
|
||
public override void _Ready()
|
||
{
|
||
var menu = GetMenu();
|
||
// 移除“全选”菜单项。
|
||
menu.RemoveItem(RichTextLabel.MenuItems.SelectAll);
|
||
// 添加自定义菜单项。
|
||
menu.AddSeparator();
|
||
menu.AddItem("制作文本副本", RichTextLabel.MenuItems.Max + 1);
|
||
// 添加事件处理器。
|
||
menu.IdPressed += OnItemPressed;
|
||
}
|
||
|
||
public void OnItemPressed(int id)
|
||
{
|
||
if (id == TextEdit.MenuItems.Max + 1)
|
||
{
|
||
AddText("\n" + GetParsedText());
|
||
}
|
||
}
|
||
|
||
|
||
|
||
\ **警告:**\ 这是必要的内部节点,将其移除或释放可能导致崩溃。如果你想要将其隐藏,或者隐藏其子节点,请使用其 :ref:`Window.visible<class_Window_property_visible>` 属性。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_paragraph_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_paragraph_count**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_paragraph_count>`
|
||
|
||
返回段落的总数(换行符或标记栈文本标签中的 ``p`` 标签)。自动换行的文本视为一个段落。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_paragraph_offset:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **get_paragraph_offset**\ (\ paragraph\: :ref:`int<class_int>`\ ) :ref:`🔗<class_RichTextLabel_method_get_paragraph_offset>`
|
||
|
||
返回位于提供的索引处的段落的垂直偏移量。
|
||
|
||
\ **注意:**\ 如果启用了 :ref:`threaded<class_RichTextLabel_property_threaded>`\ ,则该方法返回的是文档已加载部分的值。请使用 :ref:`is_finished()<class_RichTextLabel_method_is_finished>` 或 :ref:`finished<class_RichTextLabel_signal_finished>` 来确定文档是否已完全加载。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_parsed_text:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_parsed_text**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_parsed_text>`
|
||
|
||
返回没有 BBCode 标记的文本。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_selected_text:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`String<class_String>` **get_selected_text**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_selected_text>`
|
||
|
||
返回当前选中的文本。不包括 BBCode。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_selection_from:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_selection_from**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_selection_from>`
|
||
|
||
如果选区处于活动状态,则返回当前选区第一个字符的索引,否则返回 ``-1``\ 。不包括 BBCode。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_selection_line_offset:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **get_selection_line_offset**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_selection_line_offset>`
|
||
|
||
如果选取处于活动状态,则返回当前选取的垂直线偏移量,否则返回 ``-1.0``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_selection_to:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_selection_to**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_selection_to>`
|
||
|
||
如果选择处于活动状态,则返回当前选区最后一个字符的索引,否则返回 ``-1``\ 。不包括 BBCode。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_total_character_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_total_character_count**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_total_character_count>`
|
||
|
||
返回文本标签的总字符数。不包括 BBCode。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_v_scroll_bar:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`VScrollBar<class_VScrollBar>` **get_v_scroll_bar**\ (\ ) :ref:`🔗<class_RichTextLabel_method_get_v_scroll_bar>`
|
||
|
||
返回垂直滚动条。
|
||
|
||
\ **警告:**\ 这是一个必需的内部节点,删除和释放它可能会导致崩溃。如果你希望隐藏它或其任何子项,请使用它们的 :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` 属性。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_visible_content_rect:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Rect2i<class_Rect2i>` **get_visible_content_rect**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_visible_content_rect>`
|
||
|
||
返回可见内容的包围矩形。
|
||
|
||
\ **注意:**\ 该方法只会在标签发生绘制后返回正确值。
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
extends RichTextLabel
|
||
|
||
@export var background_panel: Panel
|
||
|
||
func _ready():
|
||
await draw
|
||
background_panel.position = get_visible_content_rect().position
|
||
background_panel.size = get_visible_content_rect().size
|
||
|
||
.. code-tab:: csharp
|
||
|
||
public partial class TestLabel : RichTextLabel
|
||
{
|
||
[Export]
|
||
public Panel BackgroundPanel { get; set; }
|
||
|
||
public override async void _Ready()
|
||
{
|
||
await ToSignal(this, Control.SignalName.Draw);
|
||
BackgroundGPanel.Position = GetVisibleContentRect().Position;
|
||
BackgroundPanel.Size = GetVisibleContentRect().Size;
|
||
}
|
||
}
|
||
|
||
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_visible_line_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_visible_line_count**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_visible_line_count>`
|
||
|
||
返回可见行数。
|
||
|
||
\ **注意:**\ 该方法只会在标签发生绘制后返回正确值。
|
||
|
||
\ **注意:**\ 如果启用了 :ref:`threaded<class_RichTextLabel_property_threaded>`\ ,则该方法返回的是文档已加载部分的值。请使用 :ref:`is_finished()<class_RichTextLabel_method_is_finished>` 或 :ref:`finished<class_RichTextLabel_signal_finished>` 来确定文档是否已完全加载。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_get_visible_paragraph_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_visible_paragraph_count**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_get_visible_paragraph_count>`
|
||
|
||
返回可见段落的数量。认为段落可见的标准是至少有一行可见。
|
||
|
||
\ **注意:**\ 该方法只会在标签发生绘制后返回正确值。
|
||
|
||
\ **注意:**\ 如果启用了 :ref:`threaded<class_RichTextLabel_property_threaded>`\ ,则该方法返回文档已加载部分的值。请使用 :ref:`is_finished()<class_RichTextLabel_method_is_finished>` 或 :ref:`finished<class_RichTextLabel_signal_finished>` 来确定文档是否已完全加载。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_install_effect:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **install_effect**\ (\ effect\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_RichTextLabel_method_install_effect>`
|
||
|
||
安装自定义效果。这也可以在检查器中使用 :ref:`custom_effects<class_RichTextLabel_property_custom_effects>` 属性来完成。\ ``effect`` 应该是一个有效的 :ref:`RichTextEffect<class_RichTextEffect>`\ 。
|
||
|
||
\ **示例:**\ 下面的脚本扩展自 :ref:`RichTextEffect<class_RichTextEffect>`\ :
|
||
|
||
::
|
||
|
||
# effect.gd
|
||
class_name MyCustomEffect
|
||
extends RichTextEffect
|
||
|
||
var bbcode = "my_custom_effect"
|
||
|
||
# ...
|
||
|
||
可以通过脚本在 **RichTextLabel** 中安装上述效果:
|
||
|
||
::
|
||
|
||
# rich_text_label.gd
|
||
extends RichTextLabel
|
||
|
||
func _ready():
|
||
install_effect(MyCustomEffect.new())
|
||
|
||
# 或者,如果在扩展 RichTextEffect 的脚本中不使用“class_name”:
|
||
install_effect(preload("res://effect.gd").new())
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_invalidate_paragraph:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **invalidate_paragraph**\ (\ paragraph\: :ref:`int<class_int>`\ ) :ref:`🔗<class_RichTextLabel_method_invalidate_paragraph>`
|
||
|
||
使 ``paragraph`` 和所有后续段落缓存无效。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_is_finished:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_finished**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_is_finished>`
|
||
|
||
如果启用了 :ref:`threaded<class_RichTextLabel_property_threaded>`\ ,则在后台线程完成文本处理后,返回 ``true``\ ,否则始终返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_is_menu_visible:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_menu_visible**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_is_menu_visible>`
|
||
|
||
返回菜单是否可见。请使用这个方法来代替 ``get_menu().visible``\ ,可以提高性能(因为避免了菜单的创建)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_is_ready:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_ready**\ (\ ) |const| :ref:`🔗<class_RichTextLabel_method_is_ready>`
|
||
|
||
**已弃用:** Use :ref:`is_finished()<class_RichTextLabel_method_is_finished>` instead.
|
||
|
||
如果启用了 :ref:`threaded<class_RichTextLabel_property_threaded>`\ ,则在后台线程完成文本处理后,返回 ``true``\ ,否则始终返回 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_menu_option:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **menu_option**\ (\ option\: :ref:`int<class_int>`\ ) :ref:`🔗<class_RichTextLabel_method_menu_option>`
|
||
|
||
执行 :ref:`MenuItems<enum_RichTextLabel_MenuItems>` 枚举中定义的给定操作。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_newline:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **newline**\ (\ ) :ref:`🔗<class_RichTextLabel_method_newline>`
|
||
|
||
在标签栈中添加一个换行标签。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_parse_bbcode:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **parse_bbcode**\ (\ bbcode\: :ref:`String<class_String>`\ ) :ref:`🔗<class_RichTextLabel_method_parse_bbcode>`
|
||
|
||
:ref:`append_text()<class_RichTextLabel_method_append_text>` 的赋值版本。清空标签栈并插入新内容。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_parse_expressions_for_values:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Dictionary<class_Dictionary>` **parse_expressions_for_values**\ (\ expressions\: :ref:`PackedStringArray<class_PackedStringArray>`\ ) :ref:`🔗<class_RichTextLabel_method_parse_expressions_for_values>`
|
||
|
||
将 BBCode 参数 ``expressions`` 解析为字典。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_pop:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **pop**\ (\ ) :ref:`🔗<class_RichTextLabel_method_pop>`
|
||
|
||
终止当前标签。使用 ``push_*`` 方法之后手动关闭 BBCodes。不需要遵循 ``add_*`` 方法。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_pop_all:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **pop_all**\ (\ ) :ref:`🔗<class_RichTextLabel_method_pop_all>`
|
||
|
||
终止由 ``push_*`` 方法打开的所有标签。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_pop_context:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **pop_context**\ (\ ) :ref:`🔗<class_RichTextLabel_method_pop_context>`
|
||
|
||
终止上一次 :ref:`push_context()<class_RichTextLabel_method_push_context>` 调用后打开的标签(包括上下文标记);或者如果堆栈上没有上下文标记,则终止所有标签。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_bgcolor:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_bgcolor**\ (\ bgcolor\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_RichTextLabel_method_push_bgcolor>`
|
||
|
||
将 ``[bgcolor]`` 标签添加到标签栈。
|
||
|
||
\ **注意:**\ 背景色默认存在边距,由 :ref:`text_highlight_h_padding<class_RichTextLabel_theme_constant_text_highlight_h_padding>` 和 :ref:`text_highlight_v_padding<class_RichTextLabel_theme_constant_text_highlight_v_padding>` 控制。这可能会导致相邻行/列的背景颜色重叠高亮,因此如果你想避免这种情况,请考虑将这些主题项设置为 ``0``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_bold:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_bold**\ (\ ) :ref:`🔗<class_RichTextLabel_method_push_bold>`
|
||
|
||
在标签栈中添加 ``[font]`` 标签,字体为黑体。如果当前没有 ``[i]`` 标签,则与添加 ``[b]`` 标签相同。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_bold_italics:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_bold_italics**\ (\ ) :ref:`🔗<class_RichTextLabel_method_push_bold_italics>`
|
||
|
||
在标签栈中添加 ``[font]`` 标签,字体为粗斜体。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_cell:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_cell**\ (\ ) :ref:`🔗<class_RichTextLabel_method_push_cell>`
|
||
|
||
将 ``[cell]`` 标签添加到标签栈。必须位于 ``[table]`` 标签内。有关详细信息,请参阅 :ref:`push_table()<class_RichTextLabel_method_push_table>`\ 。使用 :ref:`set_table_column_expand()<class_RichTextLabel_method_set_table_column_expand>` 设置列扩展率,使用 :ref:`set_cell_border_color()<class_RichTextLabel_method_set_cell_border_color>` 设置单元格边框,使用 :ref:`set_cell_row_background_color()<class_RichTextLabel_method_set_cell_row_background_color>` 设置单元格背景,使用 :ref:`set_cell_size_override()<class_RichTextLabel_method_set_cell_size_override>` 覆盖单元格大小,使用 :ref:`set_cell_padding()<class_RichTextLabel_method_set_cell_padding>` 设置填充。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_color**\ (\ color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_RichTextLabel_method_push_color>`
|
||
|
||
在标签栈中添加 ``[color]`` 标签。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_context:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_context**\ (\ ) :ref:`🔗<class_RichTextLabel_method_push_context>`
|
||
|
||
将上下文标记添加到标记堆栈。请参阅 :ref:`pop_context()<class_RichTextLabel_method_pop_context>`\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_customfx:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_customfx**\ (\ effect\: :ref:`RichTextEffect<class_RichTextEffect>`, env\: :ref:`Dictionary<class_Dictionary>`\ ) :ref:`🔗<class_RichTextLabel_method_push_customfx>`
|
||
|
||
将一个自定义效果标签添加到标签栈。效果不需要在 :ref:`custom_effects<class_RichTextLabel_property_custom_effects>` 中。环境被直接传入给效果。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_dropcap:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_dropcap**\ (\ string\: :ref:`String<class_String>`, font\: :ref:`Font<class_Font>`, size\: :ref:`int<class_int>`, dropcap_margins\: :ref:`Rect2<class_Rect2>` = Rect2(0, 0, 0, 0), color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), outline_size\: :ref:`int<class_int>` = 0, outline_color\: :ref:`Color<class_Color>` = Color(0, 0, 0, 0)\ ) :ref:`🔗<class_RichTextLabel_method_push_dropcap>`
|
||
|
||
将 ``[dropcap]`` 标签添加到标签堆栈中。首字下沉是一种装饰性元素,位于段落开头,比其余文本要大。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_fgcolor:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_fgcolor**\ (\ fgcolor\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_RichTextLabel_method_push_fgcolor>`
|
||
|
||
将 ``[fgcolor]`` 标签添加到标签栈。
|
||
|
||
\ **注意:**\ 前景色默认存在边距,由 :ref:`text_highlight_h_padding<class_RichTextLabel_theme_constant_text_highlight_h_padding>` 和 :ref:`text_highlight_v_padding<class_RichTextLabel_theme_constant_text_highlight_v_padding>` 控制。这可能会导致相邻行/列的前景颜色重叠高亮,因此如果你想避免这种情况,请考虑将这些主题项设置为 ``0``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_font:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_font**\ (\ font\: :ref:`Font<class_Font>`, font_size\: :ref:`int<class_int>` = 0\ ) :ref:`🔗<class_RichTextLabel_method_push_font>`
|
||
|
||
在标签栈中添加 ``[font]`` 标签。在其有效期内覆盖默认字体。
|
||
|
||
将 ``font_size`` 设置为 ``0`` 会使用默认字体大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_font_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_font_size**\ (\ font_size\: :ref:`int<class_int>`\ ) :ref:`🔗<class_RichTextLabel_method_push_font_size>`
|
||
|
||
在标签栈中添加 ``[font_size]`` 标签。在其有效期内覆盖默认字体大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_hint:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_hint**\ (\ description\: :ref:`String<class_String>`\ ) :ref:`🔗<class_RichTextLabel_method_push_hint>`
|
||
|
||
向标签栈中添加 ``[hint]`` 标签。类似于 BBCode 的 ``[hint=something]{text}[/hint]``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_indent:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_indent**\ (\ level\: :ref:`int<class_int>`\ ) :ref:`🔗<class_RichTextLabel_method_push_indent>`
|
||
|
||
添加一个 ``[indent]`` 标签到标签栈。将 ``level`` 乘以当前 :ref:`tab_size<class_RichTextLabel_property_tab_size>` 以确定新的边距长度。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_italics:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_italics**\ (\ ) :ref:`🔗<class_RichTextLabel_method_push_italics>`
|
||
|
||
在标签栈中添加 ``[font]`` 标签,字体为斜体。如果当前不在 ``[b]`` 标签中,则与添加 ``[i]`` 标签相同。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_language:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_language**\ (\ language\: :ref:`String<class_String>`\ ) :ref:`🔗<class_RichTextLabel_method_push_language>`
|
||
|
||
添加用于文本塑形算法和 Open-Type 字体功能的语言代码。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_list:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_list**\ (\ level\: :ref:`int<class_int>`, type\: :ref:`ListType<enum_RichTextLabel_ListType>`, capitalize\: :ref:`bool<class_bool>`, bullet\: :ref:`String<class_String>` = "•"\ ) :ref:`🔗<class_RichTextLabel_method_push_list>`
|
||
|
||
将 ``[ol]`` 或 ``[ul]`` 标签添加到标签堆栈中。将 ``level`` 乘以当前 :ref:`tab_size<class_RichTextLabel_property_tab_size>` 来确定新的边距长度。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_meta:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_meta**\ (\ data\: :ref:`Variant<class_Variant>`, underline_mode\: :ref:`MetaUnderline<enum_RichTextLabel_MetaUnderline>` = 1, tooltip\: :ref:`String<class_String>` = ""\ ) :ref:`🔗<class_RichTextLabel_method_push_meta>`
|
||
|
||
添加一个元数据标签到标签栈。类似于 BBCode ``[url=something]{text}[/url]``\ ,但是还支持非 :ref:`String<class_String>` 类型的元数据。
|
||
|
||
如果 :ref:`meta_underlined<class_RichTextLabel_property_meta_underlined>` 为 ``true``\ ,则元数据标签会显示下划线。可以使用 ``underline_mode`` 来自定义这个行为。
|
||
|
||
\ **注意:**\ 点击元数据标签默认不会发生任何事情。要分配点击后的行为,请将 :ref:`meta_clicked<class_RichTextLabel_signal_meta_clicked>` 连接到某个函数上,这样点击元数据标签时就会调用这个函数。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_mono:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_mono**\ (\ ) :ref:`🔗<class_RichTextLabel_method_push_mono>`
|
||
|
||
在标签栈中添加 ``[font]`` 标签,该标签为等宽字体。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_normal:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_normal**\ (\ ) :ref:`🔗<class_RichTextLabel_method_push_normal>`
|
||
|
||
在标签栈中添加具有正常字体的 ``[font]`` 标签。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_outline_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_outline_color**\ (\ color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_RichTextLabel_method_push_outline_color>`
|
||
|
||
在标签栈中添加 ``[outline_color]`` 标签。在其有效期内为文本添加轮廓。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_outline_size:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_outline_size**\ (\ outline_size\: :ref:`int<class_int>`\ ) :ref:`🔗<class_RichTextLabel_method_push_outline_size>`
|
||
|
||
在标签栈中添加 ``[outline_size]`` 标签。在其有效期内覆盖默认的文本轮廓大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_paragraph:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_paragraph**\ (\ alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>`, base_direction\: :ref:`TextDirection<enum_Control_TextDirection>` = 0, language\: :ref:`String<class_String>` = "", st_parser\: :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` = 0, justification_flags\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] = 163, tab_stops\: :ref:`PackedFloat32Array<class_PackedFloat32Array>` = PackedFloat32Array()\ ) :ref:`🔗<class_RichTextLabel_method_push_paragraph>`
|
||
|
||
向标签栈中添加 ``[p]`` 标签。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_strikethrough:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_strikethrough**\ (\ color\: :ref:`Color<class_Color>` = Color(0, 0, 0, 0)\ ) :ref:`🔗<class_RichTextLabel_method_push_strikethrough>`
|
||
|
||
Adds a ``[s]`` tag to the tag stack. If ``color``'s alpha value is ``0.0``, the current font's color with its alpha multiplied by :ref:`strikethrough_alpha<class_RichTextLabel_theme_constant_strikethrough_alpha>` is used.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_table:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_table**\ (\ columns\: :ref:`int<class_int>`, inline_align\: :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` = 0, align_to_row\: :ref:`int<class_int>` = -1, name\: :ref:`String<class_String>` = ""\ ) :ref:`🔗<class_RichTextLabel_method_push_table>`
|
||
|
||
向标签栈添加 ``[table=columns,inline_align]`` 标签。使用 :ref:`set_table_column_expand()<class_RichTextLabel_method_set_table_column_expand>` 设置列扩展率。使用 :ref:`push_cell()<class_RichTextLabel_method_push_cell>` 添加单元格。\ ``name`` 会用作辅助应用中的表格名。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_push_underline:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **push_underline**\ (\ color\: :ref:`Color<class_Color>` = Color(0, 0, 0, 0)\ ) :ref:`🔗<class_RichTextLabel_method_push_underline>`
|
||
|
||
Adds a ``[u]`` tag to the tag stack. If ``color``'s alpha value is ``0.0``, the current font's color with its alpha multiplied by :ref:`underline_alpha<class_RichTextLabel_theme_constant_underline_alpha>` is used.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_reload_effects:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **reload_effects**\ (\ ) :ref:`🔗<class_RichTextLabel_method_reload_effects>`
|
||
|
||
重新加载自定义效果。适用于手动修改 :ref:`custom_effects<class_RichTextLabel_property_custom_effects>` 的场合。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_remove_paragraph:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **remove_paragraph**\ (\ paragraph\: :ref:`int<class_int>`, no_invalidate\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_RichTextLabel_method_remove_paragraph>`
|
||
|
||
从标签中移除一段内容。如果该段落存在,则返回 ``true``\ 。
|
||
|
||
\ ``paragraph`` 参数是要移除的段落的索引,它可以在 ``[0, get_paragraph_count() - 1]`` 区间内取值。
|
||
|
||
如果 ``no_invalidate`` 设置为 ``true``\ ,则后续段落的缓存不会失效。如果已删除的段落完全独立(没有未关闭的标签),或者该调用是复杂编辑操作的一部分,并且 :ref:`invalidate_paragraph()<class_RichTextLabel_method_invalidate_paragraph>` 将在操作结束时调用,则使用它来更快地进行更新。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_scroll_to_line:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **scroll_to_line**\ (\ line\: :ref:`int<class_int>`\ ) :ref:`🔗<class_RichTextLabel_method_scroll_to_line>`
|
||
|
||
滚动窗口,让第一行与 ``line`` 匹配。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_scroll_to_paragraph:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **scroll_to_paragraph**\ (\ paragraph\: :ref:`int<class_int>`\ ) :ref:`🔗<class_RichTextLabel_method_scroll_to_paragraph>`
|
||
|
||
滚动窗口,让第一行与 ``paragraph`` 的第一行匹配。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_scroll_to_selection:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **scroll_to_selection**\ (\ ) :ref:`🔗<class_RichTextLabel_method_scroll_to_selection>`
|
||
|
||
滚动到当前选区的开头。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_select_all:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **select_all**\ (\ ) :ref:`🔗<class_RichTextLabel_method_select_all>`
|
||
|
||
全选文本。
|
||
|
||
如果 :ref:`selection_enabled<class_RichTextLabel_property_selection_enabled>` 为 ``false``\ ,则不会进行选择。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_set_cell_border_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_cell_border_color**\ (\ color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_RichTextLabel_method_set_cell_border_color>`
|
||
|
||
设置表格的单元格边框颜色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_set_cell_padding:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_cell_padding**\ (\ padding\: :ref:`Rect2<class_Rect2>`\ ) :ref:`🔗<class_RichTextLabel_method_set_cell_padding>`
|
||
|
||
设置表格的单元格内边距。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_set_cell_row_background_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_cell_row_background_color**\ (\ odd_row_bg\: :ref:`Color<class_Color>`, even_row_bg\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_RichTextLabel_method_set_cell_row_background_color>`
|
||
|
||
设置某个表格单元格的颜色。可以为交替行指定单独的颜色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_set_cell_size_override:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_cell_size_override**\ (\ min_size\: :ref:`Vector2<class_Vector2>`, max_size\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_RichTextLabel_method_set_cell_size_override>`
|
||
|
||
设置某个表格单元格的最小和最大尺寸覆盖。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_set_table_column_expand:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_table_column_expand**\ (\ column\: :ref:`int<class_int>`, expand\: :ref:`bool<class_bool>`, ratio\: :ref:`int<class_int>` = 1, shrink\: :ref:`bool<class_bool>` = true\ ) :ref:`🔗<class_RichTextLabel_method_set_table_column_expand>`
|
||
|
||
编辑选定列的扩展选项。如果 ``expand`` 为 ``true``\ ,则该列按其扩展比率相对于其他列的比率进行扩展。
|
||
|
||
例如,比率为 3 和 4 的两列,加上 70 像素的可用宽度,将分别扩展 30 和 40 像素。
|
||
|
||
如果 ``expand`` 为 ``false``\ ,则该列将不会对总比率产生影响。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_set_table_column_name:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_table_column_name**\ (\ column\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_RichTextLabel_method_set_table_column_name>`
|
||
|
||
为辅助应用设置表格的列名。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_method_update_image:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **update_image**\ (\ key\: :ref:`Variant<class_Variant>`, mask\: |bitfield|\[:ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>`\], image\: :ref:`Texture2D<class_Texture2D>`, width\: :ref:`int<class_int>` = 0, height\: :ref:`int<class_int>` = 0, color\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), inline_align\: :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` = 5, region\: :ref:`Rect2<class_Rect2>` = Rect2(0, 0, 0, 0), pad\: :ref:`bool<class_bool>` = false, tooltip\: :ref:`String<class_String>` = "", width_in_percent\: :ref:`bool<class_bool>` = false, height_in_percent\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_RichTextLabel_method_update_image>`
|
||
|
||
使用键 ``key`` 更新已有图像。仅更新 ``mask`` 位指定的属性。请参阅 :ref:`add_image()<class_RichTextLabel_method_add_image>`\ 。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
主题属性说明
|
||
------------
|
||
|
||
.. _class_RichTextLabel_theme_color_default_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **default_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_RichTextLabel_theme_color_default_color>`
|
||
|
||
默认文本颜色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_color_font_outline_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **font_outline_color** = ``Color(0, 0, 0, 1)`` :ref:`🔗<class_RichTextLabel_theme_color_font_outline_color>`
|
||
|
||
文本轮廓的默认色调。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_color_font_selected_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **font_selected_color** = ``Color(0, 0, 0, 0)`` :ref:`🔗<class_RichTextLabel_theme_color_font_selected_color>`
|
||
|
||
选中文本的颜色,当 :ref:`selection_enabled<class_RichTextLabel_property_selection_enabled>` 为 ``true`` 时使用。如果等于 ``Color(0, 0, 0, 0)``\ ,则它将被忽略。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_color_font_shadow_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **font_shadow_color** = ``Color(0, 0, 0, 0)`` :ref:`🔗<class_RichTextLabel_theme_color_font_shadow_color>`
|
||
|
||
字体阴影的颜色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_color_selection_color:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **selection_color** = ``Color(0.1, 0.1, 1, 0.8)`` :ref:`🔗<class_RichTextLabel_theme_color_selection_color>`
|
||
|
||
选择框的颜色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_color_table_border:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **table_border** = ``Color(0, 0, 0, 0)`` :ref:`🔗<class_RichTextLabel_theme_color_table_border>`
|
||
|
||
默认单元格边框颜色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_color_table_even_row_bg:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **table_even_row_bg** = ``Color(0, 0, 0, 0)`` :ref:`🔗<class_RichTextLabel_theme_color_table_even_row_bg>`
|
||
|
||
偶数行的默认背景色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_color_table_odd_row_bg:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Color<class_Color>` **table_odd_row_bg** = ``Color(0, 0, 0, 0)`` :ref:`🔗<class_RichTextLabel_theme_color_table_odd_row_bg>`
|
||
|
||
奇数行的默认背景色。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_constant_line_separation:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **line_separation** = ``0`` :ref:`🔗<class_RichTextLabel_theme_constant_line_separation>`
|
||
|
||
行与行之间的额外纵向留白(单位为像素),留白会被添加到行的降部。该值可以为负数。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_constant_outline_size:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **outline_size** = ``0`` :ref:`🔗<class_RichTextLabel_theme_constant_outline_size>`
|
||
|
||
文字轮廓的大小。
|
||
|
||
\ **注意:**\ 如果使用启用了 :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` 的字体,其 :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` 必须至少设置为 :ref:`outline_size<class_RichTextLabel_theme_constant_outline_size>` 的\ *两倍*\ ,轮廓渲染才能看起来正确。否则,轮廓可能会比预期的更早被切断。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_constant_paragraph_separation:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **paragraph_separation** = ``0`` :ref:`🔗<class_RichTextLabel_theme_constant_paragraph_separation>`
|
||
|
||
行与行之间的额外纵向留白(单位为像素),留白会被添加到上一行之后。该值可以为负数。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_constant_shadow_offset_x:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **shadow_offset_x** = ``1`` :ref:`🔗<class_RichTextLabel_theme_constant_shadow_offset_x>`
|
||
|
||
字体阴影的水平偏移量。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_constant_shadow_offset_y:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **shadow_offset_y** = ``1`` :ref:`🔗<class_RichTextLabel_theme_constant_shadow_offset_y>`
|
||
|
||
字体阴影的垂直偏移。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_constant_shadow_outline_size:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **shadow_outline_size** = ``1`` :ref:`🔗<class_RichTextLabel_theme_constant_shadow_outline_size>`
|
||
|
||
阴影轮廓的大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_constant_strikethrough_alpha:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **strikethrough_alpha** = ``50`` :ref:`🔗<class_RichTextLabel_theme_constant_strikethrough_alpha>`
|
||
|
||
设置默认的删除线颜色透明度(百分比)。如果删除线使用自定义颜色,则该主题项只会在自定义颜色的 Alpha 为 ``0.0``\ (完全透明)时使用。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_constant_table_h_separation:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **table_h_separation** = ``3`` :ref:`🔗<class_RichTextLabel_theme_constant_table_h_separation>`
|
||
|
||
表中元素的水平间距。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_constant_table_v_separation:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **table_v_separation** = ``3`` :ref:`🔗<class_RichTextLabel_theme_constant_table_v_separation>`
|
||
|
||
表中元素的垂直间距。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_constant_text_highlight_h_padding:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **text_highlight_h_padding** = ``3`` :ref:`🔗<class_RichTextLabel_theme_constant_text_highlight_h_padding>`
|
||
|
||
由 ``[fgcolor]`` 和 ``[bgcolor]`` 标记绘制的框周围的水平填充,不会影响文本选择的外观。要避免相邻的高亮发生覆盖,请将其设为 ``0``\ ,禁用边距。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_constant_text_highlight_v_padding:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **text_highlight_v_padding** = ``3`` :ref:`🔗<class_RichTextLabel_theme_constant_text_highlight_v_padding>`
|
||
|
||
由 ``[fgcolor]`` 和 ``[bgcolor]`` 标记绘制的框周围的垂直填充,不会影响文本选择的外观。要避免相邻的高亮发生覆盖,请将其设为 ``0``\ ,禁用边距。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_constant_underline_alpha:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **underline_alpha** = ``50`` :ref:`🔗<class_RichTextLabel_theme_constant_underline_alpha>`
|
||
|
||
设置默认的下划线颜色透明度(百分比)。如果下划线使用自定义颜色,则该主题项只会在自定义颜色的 Alpha 为 ``0.0``\ (完全透明)时使用。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_font_bold_font:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Font<class_Font>` **bold_font** :ref:`🔗<class_RichTextLabel_theme_font_bold_font>`
|
||
|
||
用于粗体字的字体。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_font_bold_italics_font:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Font<class_Font>` **bold_italics_font** :ref:`🔗<class_RichTextLabel_theme_font_bold_italics_font>`
|
||
|
||
用于粗斜体文字的字体。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_font_italics_font:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Font<class_Font>` **italics_font** :ref:`🔗<class_RichTextLabel_theme_font_italics_font>`
|
||
|
||
用于斜体字的字体。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_font_mono_font:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Font<class_Font>` **mono_font** :ref:`🔗<class_RichTextLabel_theme_font_mono_font>`
|
||
|
||
用于等宽文本的字体。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_font_normal_font:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Font<class_Font>` **normal_font** :ref:`🔗<class_RichTextLabel_theme_font_normal_font>`
|
||
|
||
默认的文本字体。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_font_size_bold_font_size:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **bold_font_size** :ref:`🔗<class_RichTextLabel_theme_font_size_bold_font_size>`
|
||
|
||
用于粗体文本的字体大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_font_size_bold_italics_font_size:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **bold_italics_font_size** :ref:`🔗<class_RichTextLabel_theme_font_size_bold_italics_font_size>`
|
||
|
||
用于粗斜体文本的字体大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_font_size_italics_font_size:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **italics_font_size** :ref:`🔗<class_RichTextLabel_theme_font_size_italics_font_size>`
|
||
|
||
用于斜体文本的字体大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_font_size_mono_font_size:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **mono_font_size** :ref:`🔗<class_RichTextLabel_theme_font_size_mono_font_size>`
|
||
|
||
用于等宽文本的字体大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_font_size_normal_font_size:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`int<class_int>` **normal_font_size** :ref:`🔗<class_RichTextLabel_theme_font_size_normal_font_size>`
|
||
|
||
默认文本字体大小。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_icon_horizontal_rule:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`Texture2D<class_Texture2D>` **horizontal_rule** :ref:`🔗<class_RichTextLabel_theme_icon_horizontal_rule>`
|
||
|
||
横线纹理。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_style_focus:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **focus** :ref:`🔗<class_RichTextLabel_theme_style_focus>`
|
||
|
||
该 **RichTextLabel** 处于聚焦状态时使用的背景。\ :ref:`focus<class_RichTextLabel_theme_style_focus>` :ref:`StyleBox<class_StyleBox>` 显示在基础 :ref:`StyleBox<class_StyleBox>` *之上*\ ,所以应该使用部分透明的 :ref:`StyleBox<class_StyleBox>`\ ,确保基础 :ref:`StyleBox<class_StyleBox>` 仍然可见。代表轮廓或下划线的 :ref:`StyleBox<class_StyleBox>` 可以很好地实现这个目的。要禁用聚焦的视觉效果,请指定 :ref:`StyleBoxEmpty<class_StyleBoxEmpty>` 资源。请注意,禁用聚焦的视觉效果会影响使用键盘/手柄进行导航的可用性,所以出于可访问性的原因,不建议这样做。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_RichTextLabel_theme_style_normal:
|
||
|
||
.. rst-class:: classref-themeproperty
|
||
|
||
:ref:`StyleBox<class_StyleBox>` **normal** :ref:`🔗<class_RichTextLabel_theme_style_normal>`
|
||
|
||
**RichTextLabel** 的正常背景。
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
|
||
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
|
||
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
|
||
.. |void| replace:: :abbr:`void (无返回值。)`
|