class_richtextlabel.rst 103 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the RichTextLabel.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_RichTextLabel:
  6. RichTextLabel
  7. =============
  8. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Label that displays rich text.
  10. Description
  11. -----------
  12. Rich text can contain custom text, fonts, images and some basic formatting. The label manages these as an internal tag stack. It also adapts itself to given width/heights.
  13. \ **Note:** Assignments to :ref:`text<class_RichTextLabel_property_text>` clear the tag stack and reconstruct it from the property's contents. Any edits made to :ref:`text<class_RichTextLabel_property_text>` will erase previous edits made from other manual sources such as :ref:`append_text<class_RichTextLabel_method_append_text>` and the ``push_*`` / :ref:`pop<class_RichTextLabel_method_pop>` methods.
  14. \ **Note:** RichTextLabel doesn't support entangled BBCode tags. For example, instead of using ``[b]bold[i]bold italic[/b]italic[/i]``, use ``[b]bold[i]bold italic[/i][/b][i]italic[/i]``.
  15. \ **Note:** ``push_*/pop`` functions won't affect BBCode.
  16. \ **Note:** Unlike :ref:`Label<class_Label>`, RichTextLabel doesn't have a *property* to horizontally align text to the center. Instead, enable :ref:`bbcode_enabled<class_RichTextLabel_property_bbcode_enabled>` and surround the text in a ``[center]`` tag as follows: ``[center]Example[/center]``. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the :ref:`fit_content_height<class_RichTextLabel_property_fit_content_height>` property.
  17. Tutorials
  18. ---------
  19. - :doc:`BBCode in RichTextLabel <../tutorials/ui/bbcode_in_richtextlabel>`
  20. - `GUI Rich Text/BBcode Demo <https://godotengine.org/asset-library/asset/132>`__
  21. - `OS Test Demo <https://godotengine.org/asset-library/asset/677>`__
  22. Properties
  23. ----------
  24. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  25. | :ref:`AutowrapMode<enum_RichTextLabel_AutowrapMode>` | :ref:`autowrap_mode<class_RichTextLabel_property_autowrap_mode>` | ``3`` |
  26. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`bbcode_enabled<class_RichTextLabel_property_bbcode_enabled>` | ``false`` |
  28. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | clip_contents | ``true`` (overrides :ref:`Control<class_Control_property_clip_contents>`) |
  30. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  31. | :ref:`Array<class_Array>` | :ref:`custom_effects<class_RichTextLabel_property_custom_effects>` | ``[]`` |
  32. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`deselect_on_focus_loss_enabled<class_RichTextLabel_property_deselect_on_focus_loss_enabled>` | ``true`` |
  34. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`fit_content_height<class_RichTextLabel_property_fit_content_height>` | ``false`` |
  36. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  37. | :ref:`String<class_String>` | :ref:`language<class_RichTextLabel_property_language>` | ``""`` |
  38. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`meta_underlined<class_RichTextLabel_property_meta_underlined>` | ``true`` |
  40. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`override_selected_font_color<class_RichTextLabel_property_override_selected_font_color>` | ``false`` |
  42. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  43. | :ref:`float<class_float>` | :ref:`percent_visible<class_RichTextLabel_property_percent_visible>` | ``1.0`` |
  44. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  45. | :ref:`bool<class_bool>` | :ref:`scroll_active<class_RichTextLabel_property_scroll_active>` | ``true`` |
  46. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`scroll_following<class_RichTextLabel_property_scroll_following>` | ``false`` |
  48. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  49. | :ref:`bool<class_bool>` | :ref:`selection_enabled<class_RichTextLabel_property_selection_enabled>` | ``false`` |
  50. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  51. | :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` | :ref:`structured_text_bidi_override<class_RichTextLabel_property_structured_text_bidi_override>` | ``0`` |
  52. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  53. | :ref:`Array<class_Array>` | :ref:`structured_text_bidi_override_options<class_RichTextLabel_property_structured_text_bidi_override_options>` | ``[]`` |
  54. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  55. | :ref:`int<class_int>` | :ref:`tab_size<class_RichTextLabel_property_tab_size>` | ``4`` |
  56. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  57. | :ref:`String<class_String>` | :ref:`text<class_RichTextLabel_property_text>` | ``""`` |
  58. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  59. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`text_direction<class_RichTextLabel_property_text_direction>` | ``0`` |
  60. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  61. | :ref:`int<class_int>` | :ref:`visible_characters<class_RichTextLabel_property_visible_characters>` | ``-1`` |
  62. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  63. | :ref:`VisibleCharactersBehavior<enum_RichTextLabel_VisibleCharactersBehavior>` | :ref:`visible_characters_behavior<class_RichTextLabel_property_visible_characters_behavior>` | ``0`` |
  64. +--------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  65. Methods
  66. -------
  67. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | void | :ref:`add_image<class_RichTextLabel_method_add_image>` **(** :ref:`Texture2D<class_Texture2D>` image, :ref:`int<class_int>` width=0, :ref:`int<class_int>` height=0, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1), :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=5 **)** |
  69. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | void | :ref:`add_text<class_RichTextLabel_method_add_text>` **(** :ref:`String<class_String>` text **)** |
  71. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | void | :ref:`append_text<class_RichTextLabel_method_append_text>` **(** :ref:`String<class_String>` bbcode **)** |
  73. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`clear<class_RichTextLabel_method_clear>` **(** **)** |
  75. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`int<class_int>` | :ref:`get_character_line<class_RichTextLabel_method_get_character_line>` **(** :ref:`int<class_int>` character **)** |
  77. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`int<class_int>` | :ref:`get_character_paragraph<class_RichTextLabel_method_get_character_paragraph>` **(** :ref:`int<class_int>` character **)** |
  79. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`int<class_int>` | :ref:`get_content_height<class_RichTextLabel_method_get_content_height>` **(** **)** |const| |
  81. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`int<class_int>` | :ref:`get_content_width<class_RichTextLabel_method_get_content_width>` **(** **)** |const| |
  83. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`int<class_int>` | :ref:`get_line_count<class_RichTextLabel_method_get_line_count>` **(** **)** |const| |
  85. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`float<class_float>` | :ref:`get_line_offset<class_RichTextLabel_method_get_line_offset>` **(** :ref:`int<class_int>` line **)** |
  87. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`int<class_int>` | :ref:`get_paragraph_count<class_RichTextLabel_method_get_paragraph_count>` **(** **)** |const| |
  89. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`float<class_float>` | :ref:`get_paragraph_offset<class_RichTextLabel_method_get_paragraph_offset>` **(** :ref:`int<class_int>` paragraph **)** |
  91. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`String<class_String>` | :ref:`get_parsed_text<class_RichTextLabel_method_get_parsed_text>` **(** **)** |const| |
  93. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`String<class_String>` | :ref:`get_selected_text<class_RichTextLabel_method_get_selected_text>` **(** **)** |const| |
  95. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`int<class_int>` | :ref:`get_selection_from<class_RichTextLabel_method_get_selection_from>` **(** **)** |const| |
  97. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`int<class_int>` | :ref:`get_selection_to<class_RichTextLabel_method_get_selection_to>` **(** **)** |const| |
  99. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`int<class_int>` | :ref:`get_total_character_count<class_RichTextLabel_method_get_total_character_count>` **(** **)** |const| |
  101. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`VScrollBar<class_VScrollBar>` | :ref:`get_v_scroll_bar<class_RichTextLabel_method_get_v_scroll_bar>` **(** **)** |
  103. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`int<class_int>` | :ref:`get_visible_line_count<class_RichTextLabel_method_get_visible_line_count>` **(** **)** |const| |
  105. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`int<class_int>` | :ref:`get_visible_paragraph_count<class_RichTextLabel_method_get_visible_paragraph_count>` **(** **)** |const| |
  107. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | void | :ref:`install_effect<class_RichTextLabel_method_install_effect>` **(** :ref:`Variant<class_Variant>` effect **)** |
  109. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | void | :ref:`newline<class_RichTextLabel_method_newline>` **(** **)** |
  111. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | void | :ref:`parse_bbcode<class_RichTextLabel_method_parse_bbcode>` **(** :ref:`String<class_String>` bbcode **)** |
  113. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`Dictionary<class_Dictionary>` | :ref:`parse_expressions_for_values<class_RichTextLabel_method_parse_expressions_for_values>` **(** :ref:`PackedStringArray<class_PackedStringArray>` expressions **)** |
  115. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | void | :ref:`pop<class_RichTextLabel_method_pop>` **(** **)** |
  117. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | void | :ref:`push_bgcolor<class_RichTextLabel_method_push_bgcolor>` **(** :ref:`Color<class_Color>` bgcolor **)** |
  119. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | void | :ref:`push_bold<class_RichTextLabel_method_push_bold>` **(** **)** |
  121. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | void | :ref:`push_bold_italics<class_RichTextLabel_method_push_bold_italics>` **(** **)** |
  123. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | void | :ref:`push_cell<class_RichTextLabel_method_push_cell>` **(** **)** |
  125. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | void | :ref:`push_color<class_RichTextLabel_method_push_color>` **(** :ref:`Color<class_Color>` color **)** |
  127. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | void | :ref:`push_dropcap<class_RichTextLabel_method_push_dropcap>` **(** :ref:`String<class_String>` string, :ref:`Font<class_Font>` font, :ref:`int<class_int>` size, :ref:`Rect2<class_Rect2>` dropcap_margins=Rect2(0, 0, 0, 0), :ref:`Color<class_Color>` color=Color(1, 1, 1, 1), :ref:`int<class_int>` outline_size=0, :ref:`Color<class_Color>` outline_color=Color(0, 0, 0, 0) **)** |
  129. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | void | :ref:`push_fgcolor<class_RichTextLabel_method_push_fgcolor>` **(** :ref:`Color<class_Color>` fgcolor **)** |
  131. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | void | :ref:`push_font<class_RichTextLabel_method_push_font>` **(** :ref:`Font<class_Font>` font **)** |
  133. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | void | :ref:`push_font_features<class_RichTextLabel_method_push_font_features>` **(** :ref:`Dictionary<class_Dictionary>` opentype_features **)** |
  135. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | void | :ref:`push_font_size<class_RichTextLabel_method_push_font_size>` **(** :ref:`int<class_int>` font_size **)** |
  137. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | void | :ref:`push_indent<class_RichTextLabel_method_push_indent>` **(** :ref:`int<class_int>` level **)** |
  139. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | void | :ref:`push_italics<class_RichTextLabel_method_push_italics>` **(** **)** |
  141. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | void | :ref:`push_list<class_RichTextLabel_method_push_list>` **(** :ref:`int<class_int>` level, :ref:`ListType<enum_RichTextLabel_ListType>` type, :ref:`bool<class_bool>` capitalize **)** |
  143. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | void | :ref:`push_meta<class_RichTextLabel_method_push_meta>` **(** :ref:`Variant<class_Variant>` data **)** |
  145. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | void | :ref:`push_mono<class_RichTextLabel_method_push_mono>` **(** **)** |
  147. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | void | :ref:`push_normal<class_RichTextLabel_method_push_normal>` **(** **)** |
  149. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | void | :ref:`push_outline_color<class_RichTextLabel_method_push_outline_color>` **(** :ref:`Color<class_Color>` color **)** |
  151. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | void | :ref:`push_outline_size<class_RichTextLabel_method_push_outline_size>` **(** :ref:`int<class_int>` outline_size **)** |
  153. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | void | :ref:`push_paragraph<class_RichTextLabel_method_push_paragraph>` **(** :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` alignment, :ref:`TextDirection<enum_Control_TextDirection>` base_direction=0, :ref:`String<class_String>` language="", :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` st_parser=0 **)** |
  155. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | void | :ref:`push_strikethrough<class_RichTextLabel_method_push_strikethrough>` **(** **)** |
  157. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | void | :ref:`push_table<class_RichTextLabel_method_push_table>` **(** :ref:`int<class_int>` columns, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=0 **)** |
  159. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | void | :ref:`push_underline<class_RichTextLabel_method_push_underline>` **(** **)** |
  161. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | :ref:`bool<class_bool>` | :ref:`remove_line<class_RichTextLabel_method_remove_line>` **(** :ref:`int<class_int>` line **)** |
  163. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | void | :ref:`scroll_to_line<class_RichTextLabel_method_scroll_to_line>` **(** :ref:`int<class_int>` line **)** |
  165. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | void | :ref:`scroll_to_paragraph<class_RichTextLabel_method_scroll_to_paragraph>` **(** :ref:`int<class_int>` paragraph **)** |
  167. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | void | :ref:`set_cell_border_color<class_RichTextLabel_method_set_cell_border_color>` **(** :ref:`Color<class_Color>` color **)** |
  169. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | void | :ref:`set_cell_padding<class_RichTextLabel_method_set_cell_padding>` **(** :ref:`Rect2<class_Rect2>` padding **)** |
  171. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | void | :ref:`set_cell_row_background_color<class_RichTextLabel_method_set_cell_row_background_color>` **(** :ref:`Color<class_Color>` odd_row_bg, :ref:`Color<class_Color>` even_row_bg **)** |
  173. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | void | :ref:`set_cell_size_override<class_RichTextLabel_method_set_cell_size_override>` **(** :ref:`Vector2<class_Vector2>` min_size, :ref:`Vector2<class_Vector2>` max_size **)** |
  175. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | void | :ref:`set_table_column_expand<class_RichTextLabel_method_set_table_column_expand>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` expand, :ref:`int<class_int>` ratio **)** |
  177. +-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. Theme Properties
  179. ----------------
  180. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  181. | :ref:`Color<class_Color>` | :ref:`default_color<class_RichTextLabel_theme_color_default_color>` | ``Color(1, 1, 1, 1)`` |
  182. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  183. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_RichTextLabel_theme_color_font_outline_color>` | ``Color(1, 1, 1, 1)`` |
  184. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  185. | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_RichTextLabel_theme_color_font_selected_color>` | ``Color(0, 0, 0, 1)`` |
  186. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  187. | :ref:`Color<class_Color>` | :ref:`font_shadow_color<class_RichTextLabel_theme_color_font_shadow_color>` | ``Color(0, 0, 0, 0)`` |
  188. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  189. | :ref:`Color<class_Color>` | :ref:`selection_color<class_RichTextLabel_theme_color_selection_color>` | ``Color(0.1, 0.1, 1, 0.8)`` |
  190. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  191. | :ref:`Color<class_Color>` | :ref:`table_border<class_RichTextLabel_theme_color_table_border>` | ``Color(0, 0, 0, 0)`` |
  192. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  193. | :ref:`Color<class_Color>` | :ref:`table_even_row_bg<class_RichTextLabel_theme_color_table_even_row_bg>` | ``Color(0, 0, 0, 0)`` |
  194. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  195. | :ref:`Color<class_Color>` | :ref:`table_odd_row_bg<class_RichTextLabel_theme_color_table_odd_row_bg>` | ``Color(0, 0, 0, 0)`` |
  196. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  197. | :ref:`int<class_int>` | :ref:`line_separation<class_RichTextLabel_theme_constant_line_separation>` | ``0`` |
  198. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  199. | :ref:`int<class_int>` | :ref:`outline_size<class_RichTextLabel_theme_constant_outline_size>` | ``0`` |
  200. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  201. | :ref:`int<class_int>` | :ref:`shadow_offset_x<class_RichTextLabel_theme_constant_shadow_offset_x>` | ``1`` |
  202. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  203. | :ref:`int<class_int>` | :ref:`shadow_offset_y<class_RichTextLabel_theme_constant_shadow_offset_y>` | ``1`` |
  204. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  205. | :ref:`int<class_int>` | :ref:`shadow_outline_size<class_RichTextLabel_theme_constant_shadow_outline_size>` | ``1`` |
  206. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  207. | :ref:`int<class_int>` | :ref:`table_hseparation<class_RichTextLabel_theme_constant_table_hseparation>` | ``3`` |
  208. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  209. | :ref:`int<class_int>` | :ref:`table_vseparation<class_RichTextLabel_theme_constant_table_vseparation>` | ``3`` |
  210. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  211. | :ref:`Font<class_Font>` | :ref:`bold_font<class_RichTextLabel_theme_font_bold_font>` | |
  212. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  213. | :ref:`Font<class_Font>` | :ref:`bold_italics_font<class_RichTextLabel_theme_font_bold_italics_font>` | |
  214. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  215. | :ref:`Font<class_Font>` | :ref:`italics_font<class_RichTextLabel_theme_font_italics_font>` | |
  216. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  217. | :ref:`Font<class_Font>` | :ref:`mono_font<class_RichTextLabel_theme_font_mono_font>` | |
  218. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  219. | :ref:`Font<class_Font>` | :ref:`normal_font<class_RichTextLabel_theme_font_normal_font>` | |
  220. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  221. | :ref:`int<class_int>` | :ref:`bold_font_size<class_RichTextLabel_theme_font_size_bold_font_size>` | |
  222. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  223. | :ref:`int<class_int>` | :ref:`bold_italics_font_size<class_RichTextLabel_theme_font_size_bold_italics_font_size>` | |
  224. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  225. | :ref:`int<class_int>` | :ref:`italics_font_size<class_RichTextLabel_theme_font_size_italics_font_size>` | |
  226. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  227. | :ref:`int<class_int>` | :ref:`mono_font_size<class_RichTextLabel_theme_font_size_mono_font_size>` | |
  228. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  229. | :ref:`int<class_int>` | :ref:`normal_font_size<class_RichTextLabel_theme_font_size_normal_font_size>` | |
  230. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  231. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_RichTextLabel_theme_style_focus>` | |
  232. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  233. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_RichTextLabel_theme_style_normal>` | |
  234. +---------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  235. Signals
  236. -------
  237. .. _class_RichTextLabel_signal_meta_clicked:
  238. - **meta_clicked** **(** :ref:`Variant<class_Variant>` meta **)**
  239. Triggered when the user clicks on content between meta tags. If the meta is defined in text, e.g. ``[url={"data"="hi"}]hi[/url]``, then the parameter for this signal will be a :ref:`String<class_String>` type. If a particular type or an object is desired, the :ref:`push_meta<class_RichTextLabel_method_push_meta>` method must be used to manually insert the data into the tag stack.
  240. ----
  241. .. _class_RichTextLabel_signal_meta_hover_ended:
  242. - **meta_hover_ended** **(** :ref:`Variant<class_Variant>` meta **)**
  243. Triggers when the mouse exits a meta tag.
  244. ----
  245. .. _class_RichTextLabel_signal_meta_hover_started:
  246. - **meta_hover_started** **(** :ref:`Variant<class_Variant>` meta **)**
  247. Triggers when the mouse enters a meta tag.
  248. Enumerations
  249. ------------
  250. .. _enum_RichTextLabel_AutowrapMode:
  251. .. _class_RichTextLabel_constant_AUTOWRAP_OFF:
  252. .. _class_RichTextLabel_constant_AUTOWRAP_ARBITRARY:
  253. .. _class_RichTextLabel_constant_AUTOWRAP_WORD:
  254. .. _class_RichTextLabel_constant_AUTOWRAP_WORD_SMART:
  255. enum **AutowrapMode**:
  256. - **AUTOWRAP_OFF** = **0** --- Autowrap is disabled.
  257. - **AUTOWRAP_ARBITRARY** = **1** --- Wraps the text inside the node's bounding rectangle by allowing to break lines at arbitrary positions, which is useful when very limited space is available.
  258. - **AUTOWRAP_WORD** = **2** --- Wraps the text inside the node's bounding rectangle by soft-breaking between words.
  259. - **AUTOWRAP_WORD_SMART** = **3** --- Behaves similarly to :ref:`AUTOWRAP_WORD<class_RichTextLabel_constant_AUTOWRAP_WORD>`, but force-breaks a word if that single word does not fit in one line.
  260. ----
  261. .. _enum_RichTextLabel_ListType:
  262. .. _class_RichTextLabel_constant_LIST_NUMBERS:
  263. .. _class_RichTextLabel_constant_LIST_LETTERS:
  264. .. _class_RichTextLabel_constant_LIST_ROMAN:
  265. .. _class_RichTextLabel_constant_LIST_DOTS:
  266. enum **ListType**:
  267. - **LIST_NUMBERS** = **0** --- Each list item has a number marker.
  268. - **LIST_LETTERS** = **1** --- Each list item has a letter marker.
  269. - **LIST_ROMAN** = **2** --- Each list item has a roman number marker.
  270. - **LIST_DOTS** = **3** --- Each list item has a filled circle marker.
  271. ----
  272. .. _enum_RichTextLabel_ItemType:
  273. .. _class_RichTextLabel_constant_ITEM_FRAME:
  274. .. _class_RichTextLabel_constant_ITEM_TEXT:
  275. .. _class_RichTextLabel_constant_ITEM_IMAGE:
  276. .. _class_RichTextLabel_constant_ITEM_NEWLINE:
  277. .. _class_RichTextLabel_constant_ITEM_FONT:
  278. .. _class_RichTextLabel_constant_ITEM_FONT_SIZE:
  279. .. _class_RichTextLabel_constant_ITEM_FONT_FEATURES:
  280. .. _class_RichTextLabel_constant_ITEM_COLOR:
  281. .. _class_RichTextLabel_constant_ITEM_OUTLINE_SIZE:
  282. .. _class_RichTextLabel_constant_ITEM_OUTLINE_COLOR:
  283. .. _class_RichTextLabel_constant_ITEM_UNDERLINE:
  284. .. _class_RichTextLabel_constant_ITEM_STRIKETHROUGH:
  285. .. _class_RichTextLabel_constant_ITEM_PARAGRAPH:
  286. .. _class_RichTextLabel_constant_ITEM_INDENT:
  287. .. _class_RichTextLabel_constant_ITEM_LIST:
  288. .. _class_RichTextLabel_constant_ITEM_TABLE:
  289. .. _class_RichTextLabel_constant_ITEM_FADE:
  290. .. _class_RichTextLabel_constant_ITEM_SHAKE:
  291. .. _class_RichTextLabel_constant_ITEM_WAVE:
  292. .. _class_RichTextLabel_constant_ITEM_TORNADO:
  293. .. _class_RichTextLabel_constant_ITEM_RAINBOW:
  294. .. _class_RichTextLabel_constant_ITEM_BGCOLOR:
  295. .. _class_RichTextLabel_constant_ITEM_FGCOLOR:
  296. .. _class_RichTextLabel_constant_ITEM_META:
  297. .. _class_RichTextLabel_constant_ITEM_DROPCAP:
  298. .. _class_RichTextLabel_constant_ITEM_CUSTOMFX:
  299. enum **ItemType**:
  300. - **ITEM_FRAME** = **0**
  301. - **ITEM_TEXT** = **1**
  302. - **ITEM_IMAGE** = **2**
  303. - **ITEM_NEWLINE** = **3**
  304. - **ITEM_FONT** = **4**
  305. - **ITEM_FONT_SIZE** = **5**
  306. - **ITEM_FONT_FEATURES** = **6**
  307. - **ITEM_COLOR** = **7**
  308. - **ITEM_OUTLINE_SIZE** = **8**
  309. - **ITEM_OUTLINE_COLOR** = **9**
  310. - **ITEM_UNDERLINE** = **10**
  311. - **ITEM_STRIKETHROUGH** = **11**
  312. - **ITEM_PARAGRAPH** = **12**
  313. - **ITEM_INDENT** = **13**
  314. - **ITEM_LIST** = **14**
  315. - **ITEM_TABLE** = **15**
  316. - **ITEM_FADE** = **16**
  317. - **ITEM_SHAKE** = **17**
  318. - **ITEM_WAVE** = **18**
  319. - **ITEM_TORNADO** = **19**
  320. - **ITEM_RAINBOW** = **20**
  321. - **ITEM_BGCOLOR** = **21**
  322. - **ITEM_FGCOLOR** = **22**
  323. - **ITEM_META** = **23**
  324. - **ITEM_DROPCAP** = **24**
  325. - **ITEM_CUSTOMFX** = **25**
  326. ----
  327. .. _enum_RichTextLabel_VisibleCharactersBehavior:
  328. .. _class_RichTextLabel_constant_VC_CHARS_BEFORE_SHAPING:
  329. .. _class_RichTextLabel_constant_VC_CHARS_AFTER_SHAPING:
  330. .. _class_RichTextLabel_constant_VC_GLYPHS_AUTO:
  331. .. _class_RichTextLabel_constant_VC_GLYPHS_LTR:
  332. .. _class_RichTextLabel_constant_VC_GLYPHS_RTL:
  333. enum **VisibleCharactersBehavior**:
  334. - **VC_CHARS_BEFORE_SHAPING** = **0** --- Trims text before the shaping. e.g, increasing :ref:`visible_characters<class_RichTextLabel_property_visible_characters>` value is visually identical to typing the text.
  335. - **VC_CHARS_AFTER_SHAPING** = **1** --- Displays glyphs that are mapped to the first :ref:`visible_characters<class_RichTextLabel_property_visible_characters>` characters from the beginning of the text.
  336. - **VC_GLYPHS_AUTO** = **2** --- Displays :ref:`percent_visible<class_RichTextLabel_property_percent_visible>` glyphs, starting from the left or from the right, depending on :ref:`Control.layout_direction<class_Control_property_layout_direction>` value.
  337. - **VC_GLYPHS_LTR** = **3** --- Displays :ref:`percent_visible<class_RichTextLabel_property_percent_visible>` glyphs, starting from the left.
  338. - **VC_GLYPHS_RTL** = **4** --- Displays :ref:`percent_visible<class_RichTextLabel_property_percent_visible>` glyphs, starting from the right.
  339. Property Descriptions
  340. ---------------------
  341. .. _class_RichTextLabel_property_autowrap_mode:
  342. - :ref:`AutowrapMode<enum_RichTextLabel_AutowrapMode>` **autowrap_mode**
  343. +-----------+--------------------------+
  344. | *Default* | ``3`` |
  345. +-----------+--------------------------+
  346. | *Setter* | set_autowrap_mode(value) |
  347. +-----------+--------------------------+
  348. | *Getter* | get_autowrap_mode() |
  349. +-----------+--------------------------+
  350. If set to something other than :ref:`AUTOWRAP_OFF<class_RichTextLabel_constant_AUTOWRAP_OFF>`, the text gets wrapped inside the node's bounding rectangle. To see how each mode behaves, see :ref:`AutowrapMode<enum_RichTextLabel_AutowrapMode>`.
  351. ----
  352. .. _class_RichTextLabel_property_bbcode_enabled:
  353. - :ref:`bool<class_bool>` **bbcode_enabled**
  354. +-----------+-----------------------+
  355. | *Default* | ``false`` |
  356. +-----------+-----------------------+
  357. | *Setter* | set_use_bbcode(value) |
  358. +-----------+-----------------------+
  359. | *Getter* | is_using_bbcode() |
  360. +-----------+-----------------------+
  361. If ``true``, the label uses BBCode formatting.
  362. ----
  363. .. _class_RichTextLabel_property_custom_effects:
  364. - :ref:`Array<class_Array>` **custom_effects**
  365. +-----------+--------------------+
  366. | *Default* | ``[]`` |
  367. +-----------+--------------------+
  368. | *Setter* | set_effects(value) |
  369. +-----------+--------------------+
  370. | *Getter* | get_effects() |
  371. +-----------+--------------------+
  372. The currently installed custom effects. This is an array of :ref:`RichTextEffect<class_RichTextEffect>`\ s.
  373. To add a custom effect, it's more convenient to use :ref:`install_effect<class_RichTextLabel_method_install_effect>`.
  374. ----
  375. .. _class_RichTextLabel_property_deselect_on_focus_loss_enabled:
  376. - :ref:`bool<class_bool>` **deselect_on_focus_loss_enabled**
  377. +-----------+-------------------------------------------+
  378. | *Default* | ``true`` |
  379. +-----------+-------------------------------------------+
  380. | *Setter* | set_deselect_on_focus_loss_enabled(value) |
  381. +-----------+-------------------------------------------+
  382. | *Getter* | is_deselect_on_focus_loss_enabled() |
  383. +-----------+-------------------------------------------+
  384. If ``true``, the selected text will be deselected when focus is lost.
  385. ----
  386. .. _class_RichTextLabel_property_fit_content_height:
  387. - :ref:`bool<class_bool>` **fit_content_height**
  388. +-----------+---------------------------------+
  389. | *Default* | ``false`` |
  390. +-----------+---------------------------------+
  391. | *Setter* | set_fit_content_height(value) |
  392. +-----------+---------------------------------+
  393. | *Getter* | is_fit_content_height_enabled() |
  394. +-----------+---------------------------------+
  395. If ``true``, the label's height will be automatically updated to fit its content.
  396. \ **Note:** This property is used as a workaround to fix issues with ``RichTextLabel`` in :ref:`Container<class_Container>`\ s, but it's unreliable in some cases and will be removed in future versions.
  397. ----
  398. .. _class_RichTextLabel_property_language:
  399. - :ref:`String<class_String>` **language**
  400. +-----------+---------------------+
  401. | *Default* | ``""`` |
  402. +-----------+---------------------+
  403. | *Setter* | set_language(value) |
  404. +-----------+---------------------+
  405. | *Getter* | get_language() |
  406. +-----------+---------------------+
  407. Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
  408. ----
  409. .. _class_RichTextLabel_property_meta_underlined:
  410. - :ref:`bool<class_bool>` **meta_underlined**
  411. +-----------+---------------------------+
  412. | *Default* | ``true`` |
  413. +-----------+---------------------------+
  414. | *Setter* | set_meta_underline(value) |
  415. +-----------+---------------------------+
  416. | *Getter* | is_meta_underlined() |
  417. +-----------+---------------------------+
  418. If ``true``, the label underlines meta tags such as ``[url]{text}[/url]``.
  419. ----
  420. .. _class_RichTextLabel_property_override_selected_font_color:
  421. - :ref:`bool<class_bool>` **override_selected_font_color**
  422. +-----------+-----------------------------------------+
  423. | *Default* | ``false`` |
  424. +-----------+-----------------------------------------+
  425. | *Setter* | set_override_selected_font_color(value) |
  426. +-----------+-----------------------------------------+
  427. | *Getter* | is_overriding_selected_font_color() |
  428. +-----------+-----------------------------------------+
  429. If ``true``, the label uses the custom font color.
  430. ----
  431. .. _class_RichTextLabel_property_percent_visible:
  432. - :ref:`float<class_float>` **percent_visible**
  433. +-----------+----------------------------+
  434. | *Default* | ``1.0`` |
  435. +-----------+----------------------------+
  436. | *Setter* | set_percent_visible(value) |
  437. +-----------+----------------------------+
  438. | *Getter* | get_percent_visible() |
  439. +-----------+----------------------------+
  440. The range of characters to display, as a :ref:`float<class_float>` between 0.0 and 1.0. When assigned an out of range value, it's the same as assigning 1.0.
  441. \ **Note:** Setting this property updates :ref:`visible_characters<class_RichTextLabel_property_visible_characters>` based on current :ref:`get_total_character_count<class_RichTextLabel_method_get_total_character_count>`.
  442. ----
  443. .. _class_RichTextLabel_property_scroll_active:
  444. - :ref:`bool<class_bool>` **scroll_active**
  445. +-----------+--------------------------+
  446. | *Default* | ``true`` |
  447. +-----------+--------------------------+
  448. | *Setter* | set_scroll_active(value) |
  449. +-----------+--------------------------+
  450. | *Getter* | is_scroll_active() |
  451. +-----------+--------------------------+
  452. If ``true``, the scrollbar is visible. Setting this to ``false`` does not block scrolling completely. See :ref:`scroll_to_line<class_RichTextLabel_method_scroll_to_line>`.
  453. ----
  454. .. _class_RichTextLabel_property_scroll_following:
  455. - :ref:`bool<class_bool>` **scroll_following**
  456. +-----------+--------------------------+
  457. | *Default* | ``false`` |
  458. +-----------+--------------------------+
  459. | *Setter* | set_scroll_follow(value) |
  460. +-----------+--------------------------+
  461. | *Getter* | is_scroll_following() |
  462. +-----------+--------------------------+
  463. If ``true``, the window scrolls down to display new content automatically.
  464. ----
  465. .. _class_RichTextLabel_property_selection_enabled:
  466. - :ref:`bool<class_bool>` **selection_enabled**
  467. +-----------+------------------------------+
  468. | *Default* | ``false`` |
  469. +-----------+------------------------------+
  470. | *Setter* | set_selection_enabled(value) |
  471. +-----------+------------------------------+
  472. | *Getter* | is_selection_enabled() |
  473. +-----------+------------------------------+
  474. If ``true``, the label allows text selection.
  475. ----
  476. .. _class_RichTextLabel_property_structured_text_bidi_override:
  477. - :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` **structured_text_bidi_override**
  478. +-----------+------------------------------------------+
  479. | *Default* | ``0`` |
  480. +-----------+------------------------------------------+
  481. | *Setter* | set_structured_text_bidi_override(value) |
  482. +-----------+------------------------------------------+
  483. | *Getter* | get_structured_text_bidi_override() |
  484. +-----------+------------------------------------------+
  485. Set BiDi algorithm override for the structured text.
  486. ----
  487. .. _class_RichTextLabel_property_structured_text_bidi_override_options:
  488. - :ref:`Array<class_Array>` **structured_text_bidi_override_options**
  489. +-----------+--------------------------------------------------+
  490. | *Default* | ``[]`` |
  491. +-----------+--------------------------------------------------+
  492. | *Setter* | set_structured_text_bidi_override_options(value) |
  493. +-----------+--------------------------------------------------+
  494. | *Getter* | get_structured_text_bidi_override_options() |
  495. +-----------+--------------------------------------------------+
  496. Set additional options for BiDi override.
  497. ----
  498. .. _class_RichTextLabel_property_tab_size:
  499. - :ref:`int<class_int>` **tab_size**
  500. +-----------+---------------------+
  501. | *Default* | ``4`` |
  502. +-----------+---------------------+
  503. | *Setter* | set_tab_size(value) |
  504. +-----------+---------------------+
  505. | *Getter* | get_tab_size() |
  506. +-----------+---------------------+
  507. The number of spaces associated with a single tab length. Does not affect ``\t`` in text tags, only indent tags.
  508. ----
  509. .. _class_RichTextLabel_property_text:
  510. - :ref:`String<class_String>` **text**
  511. +-----------+-----------------+
  512. | *Default* | ``""`` |
  513. +-----------+-----------------+
  514. | *Setter* | set_text(value) |
  515. +-----------+-----------------+
  516. | *Getter* | get_text() |
  517. +-----------+-----------------+
  518. The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited.
  519. \ **Note:** If :ref:`bbcode_enabled<class_RichTextLabel_property_bbcode_enabled>` is ``true``, it is unadvised to use the ``+=`` operator with ``text`` (e.g. ``text += "some string"``) as it replaces the whole text and can cause slowdowns. It will also erase all BBCode that was added to stack using ``push_*`` methods. Use :ref:`append_text<class_RichTextLabel_method_append_text>` for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call.
  520. ----
  521. .. _class_RichTextLabel_property_text_direction:
  522. - :ref:`TextDirection<enum_Control_TextDirection>` **text_direction**
  523. +-----------+---------------------------+
  524. | *Default* | ``0`` |
  525. +-----------+---------------------------+
  526. | *Setter* | set_text_direction(value) |
  527. +-----------+---------------------------+
  528. | *Getter* | get_text_direction() |
  529. +-----------+---------------------------+
  530. Base text writing direction.
  531. ----
  532. .. _class_RichTextLabel_property_visible_characters:
  533. - :ref:`int<class_int>` **visible_characters**
  534. +-----------+-------------------------------+
  535. | *Default* | ``-1`` |
  536. +-----------+-------------------------------+
  537. | *Setter* | set_visible_characters(value) |
  538. +-----------+-------------------------------+
  539. | *Getter* | get_visible_characters() |
  540. +-----------+-------------------------------+
  541. The restricted number of characters to display in the label. If ``-1``, all characters will be displayed.
  542. \ **Note:** Setting this property updates :ref:`percent_visible<class_RichTextLabel_property_percent_visible>` based on current :ref:`get_total_character_count<class_RichTextLabel_method_get_total_character_count>`.
  543. ----
  544. .. _class_RichTextLabel_property_visible_characters_behavior:
  545. - :ref:`VisibleCharactersBehavior<enum_RichTextLabel_VisibleCharactersBehavior>` **visible_characters_behavior**
  546. +-----------+----------------------------------------+
  547. | *Default* | ``0`` |
  548. +-----------+----------------------------------------+
  549. | *Setter* | set_visible_characters_behavior(value) |
  550. +-----------+----------------------------------------+
  551. | *Getter* | get_visible_characters_behavior() |
  552. +-----------+----------------------------------------+
  553. Sets the clipping behavior when :ref:`visible_characters<class_RichTextLabel_property_visible_characters>` or :ref:`percent_visible<class_RichTextLabel_property_percent_visible>` is set. See :ref:`VisibleCharactersBehavior<enum_RichTextLabel_VisibleCharactersBehavior>` for more info.
  554. Method Descriptions
  555. -------------------
  556. .. _class_RichTextLabel_method_add_image:
  557. - void **add_image** **(** :ref:`Texture2D<class_Texture2D>` image, :ref:`int<class_int>` width=0, :ref:`int<class_int>` height=0, :ref:`Color<class_Color>` color=Color(1, 1, 1, 1), :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=5 **)**
  558. Adds an image's opening and closing tags to the tag stack, optionally providing a ``width`` and ``height`` to resize the image and a ``color`` to tint the image.
  559. If ``width`` or ``height`` is set to 0, the image size will be adjusted in order to keep the original aspect ratio.
  560. ----
  561. .. _class_RichTextLabel_method_add_text:
  562. - void **add_text** **(** :ref:`String<class_String>` text **)**
  563. Adds raw non-BBCode-parsed text to the tag stack.
  564. ----
  565. .. _class_RichTextLabel_method_append_text:
  566. - void **append_text** **(** :ref:`String<class_String>` bbcode **)**
  567. Parses ``bbcode`` and adds tags to the tag stack as needed.
  568. \ **Note:** Using this method, you can't close a tag that was opened in a previous :ref:`append_text<class_RichTextLabel_method_append_text>` call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the :ref:`text<class_RichTextLabel_property_text>` instead of using :ref:`append_text<class_RichTextLabel_method_append_text>`.
  569. ----
  570. .. _class_RichTextLabel_method_clear:
  571. - void **clear** **(** **)**
  572. Clears the tag stack and sets :ref:`text<class_RichTextLabel_property_text>` to an empty string.
  573. ----
  574. .. _class_RichTextLabel_method_get_character_line:
  575. - :ref:`int<class_int>` **get_character_line** **(** :ref:`int<class_int>` character **)**
  576. Returns the line number of the character position provided.
  577. ----
  578. .. _class_RichTextLabel_method_get_character_paragraph:
  579. - :ref:`int<class_int>` **get_character_paragraph** **(** :ref:`int<class_int>` character **)**
  580. Returns the paragraph number of the character position provided.
  581. ----
  582. .. _class_RichTextLabel_method_get_content_height:
  583. - :ref:`int<class_int>` **get_content_height** **(** **)** |const|
  584. Returns the height of the content.
  585. ----
  586. .. _class_RichTextLabel_method_get_content_width:
  587. - :ref:`int<class_int>` **get_content_width** **(** **)** |const|
  588. Returns the width of the content.
  589. ----
  590. .. _class_RichTextLabel_method_get_line_count:
  591. - :ref:`int<class_int>` **get_line_count** **(** **)** |const|
  592. Returns the total number of lines in the text. Wrapped text is counted as multiple lines.
  593. ----
  594. .. _class_RichTextLabel_method_get_line_offset:
  595. - :ref:`float<class_float>` **get_line_offset** **(** :ref:`int<class_int>` line **)**
  596. Returns the vertical offset of the line found at the provided index.
  597. ----
  598. .. _class_RichTextLabel_method_get_paragraph_count:
  599. - :ref:`int<class_int>` **get_paragraph_count** **(** **)** |const|
  600. Returns the total number of paragraphs (newlines or ``p`` tags in the tag stack's text tags). Considers wrapped text as one paragraph.
  601. ----
  602. .. _class_RichTextLabel_method_get_paragraph_offset:
  603. - :ref:`float<class_float>` **get_paragraph_offset** **(** :ref:`int<class_int>` paragraph **)**
  604. Returns the vertical offset of the paragraph found at the provided index.
  605. ----
  606. .. _class_RichTextLabel_method_get_parsed_text:
  607. - :ref:`String<class_String>` **get_parsed_text** **(** **)** |const|
  608. Returns the text without BBCode mark-up.
  609. ----
  610. .. _class_RichTextLabel_method_get_selected_text:
  611. - :ref:`String<class_String>` **get_selected_text** **(** **)** |const|
  612. Returns the current selection text. Does not include BBCodes.
  613. ----
  614. .. _class_RichTextLabel_method_get_selection_from:
  615. - :ref:`int<class_int>` **get_selection_from** **(** **)** |const|
  616. Returns the current selection first character index if a selection is active, ``-1`` otherwise. Does not include BBCodes.
  617. ----
  618. .. _class_RichTextLabel_method_get_selection_to:
  619. - :ref:`int<class_int>` **get_selection_to** **(** **)** |const|
  620. Returns the current selection last character index if a selection is active, ``-1`` otherwise. Does not include BBCodes.
  621. ----
  622. .. _class_RichTextLabel_method_get_total_character_count:
  623. - :ref:`int<class_int>` **get_total_character_count** **(** **)** |const|
  624. Returns the total number of characters from text tags. Does not include BBCodes.
  625. ----
  626. .. _class_RichTextLabel_method_get_v_scroll_bar:
  627. - :ref:`VScrollBar<class_VScrollBar>` **get_v_scroll_bar** **(** **)**
  628. Returns the vertical scrollbar.
  629. \ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
  630. ----
  631. .. _class_RichTextLabel_method_get_visible_line_count:
  632. - :ref:`int<class_int>` **get_visible_line_count** **(** **)** |const|
  633. Returns the number of visible lines.
  634. ----
  635. .. _class_RichTextLabel_method_get_visible_paragraph_count:
  636. - :ref:`int<class_int>` **get_visible_paragraph_count** **(** **)** |const|
  637. Returns the number of visible paragraphs. A paragraph is considered visible if at least one of its lines is visible.
  638. ----
  639. .. _class_RichTextLabel_method_install_effect:
  640. - void **install_effect** **(** :ref:`Variant<class_Variant>` effect **)**
  641. Installs a custom effect. ``effect`` should be a valid :ref:`RichTextEffect<class_RichTextEffect>`.
  642. ----
  643. .. _class_RichTextLabel_method_newline:
  644. - void **newline** **(** **)**
  645. Adds a newline tag to the tag stack.
  646. ----
  647. .. _class_RichTextLabel_method_parse_bbcode:
  648. - void **parse_bbcode** **(** :ref:`String<class_String>` bbcode **)**
  649. The assignment version of :ref:`append_text<class_RichTextLabel_method_append_text>`. Clears the tag stack and inserts the new content.
  650. ----
  651. .. _class_RichTextLabel_method_parse_expressions_for_values:
  652. - :ref:`Dictionary<class_Dictionary>` **parse_expressions_for_values** **(** :ref:`PackedStringArray<class_PackedStringArray>` expressions **)**
  653. Parses BBCode parameter ``expressions`` into a dictionary.
  654. ----
  655. .. _class_RichTextLabel_method_pop:
  656. - void **pop** **(** **)**
  657. Terminates the current tag. Use after ``push_*`` methods to close BBCodes manually. Does not need to follow ``add_*`` methods.
  658. ----
  659. .. _class_RichTextLabel_method_push_bgcolor:
  660. - void **push_bgcolor** **(** :ref:`Color<class_Color>` bgcolor **)**
  661. Adds a ``[bgcolor]`` tag to the tag stack.
  662. ----
  663. .. _class_RichTextLabel_method_push_bold:
  664. - void **push_bold** **(** **)**
  665. Adds a ``[font]`` tag with a bold font to the tag stack. This is the same as adding a ``[b]`` tag if not currently in a ``[i]`` tag.
  666. ----
  667. .. _class_RichTextLabel_method_push_bold_italics:
  668. - void **push_bold_italics** **(** **)**
  669. Adds a ``[font]`` tag with a bold italics font to the tag stack.
  670. ----
  671. .. _class_RichTextLabel_method_push_cell:
  672. - void **push_cell** **(** **)**
  673. Adds a ``[cell]`` tag to the tag stack. Must be inside a ``[table]`` tag. See :ref:`push_table<class_RichTextLabel_method_push_table>` for details.
  674. ----
  675. .. _class_RichTextLabel_method_push_color:
  676. - void **push_color** **(** :ref:`Color<class_Color>` color **)**
  677. Adds a ``[color]`` tag to the tag stack.
  678. ----
  679. .. _class_RichTextLabel_method_push_dropcap:
  680. - void **push_dropcap** **(** :ref:`String<class_String>` string, :ref:`Font<class_Font>` font, :ref:`int<class_int>` size, :ref:`Rect2<class_Rect2>` dropcap_margins=Rect2(0, 0, 0, 0), :ref:`Color<class_Color>` color=Color(1, 1, 1, 1), :ref:`int<class_int>` outline_size=0, :ref:`Color<class_Color>` outline_color=Color(0, 0, 0, 0) **)**
  681. Adds a ``[dropcap]`` tag to the tag stack. Drop cap (dropped capital) is a decorative element at the beginning of a paragraph that is larger than the rest of the text.
  682. ----
  683. .. _class_RichTextLabel_method_push_fgcolor:
  684. - void **push_fgcolor** **(** :ref:`Color<class_Color>` fgcolor **)**
  685. Adds a ``[fgcolor]`` tag to the tag stack.
  686. ----
  687. .. _class_RichTextLabel_method_push_font:
  688. - void **push_font** **(** :ref:`Font<class_Font>` font **)**
  689. Adds a ``[font]`` tag to the tag stack. Overrides default fonts for its duration.
  690. ----
  691. .. _class_RichTextLabel_method_push_font_features:
  692. - void **push_font_features** **(** :ref:`Dictionary<class_Dictionary>` opentype_features **)**
  693. Adds a ``[ot_feature]`` tag to the tag stack. Overrides default OpenType font feature for its duration.
  694. ----
  695. .. _class_RichTextLabel_method_push_font_size:
  696. - void **push_font_size** **(** :ref:`int<class_int>` font_size **)**
  697. Adds a ``[font_size]`` tag to the tag stack. Overrides default font size for its duration.
  698. ----
  699. .. _class_RichTextLabel_method_push_indent:
  700. - void **push_indent** **(** :ref:`int<class_int>` level **)**
  701. Adds an ``[indent]`` tag to the tag stack. Multiplies ``level`` by current :ref:`tab_size<class_RichTextLabel_property_tab_size>` to determine new margin length.
  702. ----
  703. .. _class_RichTextLabel_method_push_italics:
  704. - void **push_italics** **(** **)**
  705. Adds a ``[font]`` tag with a italics font to the tag stack. This is the same as adding a ``[i]`` tag if not currently in a ``[b]`` tag.
  706. ----
  707. .. _class_RichTextLabel_method_push_list:
  708. - void **push_list** **(** :ref:`int<class_int>` level, :ref:`ListType<enum_RichTextLabel_ListType>` type, :ref:`bool<class_bool>` capitalize **)**
  709. Adds ``[ol]`` or ``[ul]`` tag to the tag stack. Multiplies ``level`` by current :ref:`tab_size<class_RichTextLabel_property_tab_size>` to determine new margin length.
  710. ----
  711. .. _class_RichTextLabel_method_push_meta:
  712. - void **push_meta** **(** :ref:`Variant<class_Variant>` data **)**
  713. Adds a ``[meta]`` tag to the tag stack. Similar to the BBCode ``[url=something]{text}[/url]``, but supports non-:ref:`String<class_String>` metadata types.
  714. ----
  715. .. _class_RichTextLabel_method_push_mono:
  716. - void **push_mono** **(** **)**
  717. Adds a ``[font]`` tag with a monospace font to the tag stack.
  718. ----
  719. .. _class_RichTextLabel_method_push_normal:
  720. - void **push_normal** **(** **)**
  721. Adds a ``[font]`` tag with a normal font to the tag stack.
  722. ----
  723. .. _class_RichTextLabel_method_push_outline_color:
  724. - void **push_outline_color** **(** :ref:`Color<class_Color>` color **)**
  725. Adds a ``[outline_color]`` tag to the tag stack. Adds text outline for its duration.
  726. ----
  727. .. _class_RichTextLabel_method_push_outline_size:
  728. - void **push_outline_size** **(** :ref:`int<class_int>` outline_size **)**
  729. Adds a ``[outline_size]`` tag to the tag stack. Overrides default text outline size for its duration.
  730. ----
  731. .. _class_RichTextLabel_method_push_paragraph:
  732. - void **push_paragraph** **(** :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` alignment, :ref:`TextDirection<enum_Control_TextDirection>` base_direction=0, :ref:`String<class_String>` language="", :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` st_parser=0 **)**
  733. Adds a ``[p]`` tag to the tag stack.
  734. ----
  735. .. _class_RichTextLabel_method_push_strikethrough:
  736. - void **push_strikethrough** **(** **)**
  737. Adds a ``[s]`` tag to the tag stack.
  738. ----
  739. .. _class_RichTextLabel_method_push_table:
  740. - void **push_table** **(** :ref:`int<class_int>` columns, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=0 **)**
  741. Adds a ``[table=columns,inline_align]`` tag to the tag stack.
  742. ----
  743. .. _class_RichTextLabel_method_push_underline:
  744. - void **push_underline** **(** **)**
  745. Adds a ``[u]`` tag to the tag stack.
  746. ----
  747. .. _class_RichTextLabel_method_remove_line:
  748. - :ref:`bool<class_bool>` **remove_line** **(** :ref:`int<class_int>` line **)**
  749. Removes a line of content from the label. Returns ``true`` if the line exists.
  750. The ``line`` argument is the index of the line to remove, it can take values in the interval ``[0, get_line_count() - 1]``.
  751. ----
  752. .. _class_RichTextLabel_method_scroll_to_line:
  753. - void **scroll_to_line** **(** :ref:`int<class_int>` line **)**
  754. Scrolls the window's top line to match ``line``.
  755. ----
  756. .. _class_RichTextLabel_method_scroll_to_paragraph:
  757. - void **scroll_to_paragraph** **(** :ref:`int<class_int>` paragraph **)**
  758. Scrolls the window's top line to match first line of the ``paragraph``.
  759. ----
  760. .. _class_RichTextLabel_method_set_cell_border_color:
  761. - void **set_cell_border_color** **(** :ref:`Color<class_Color>` color **)**
  762. Sets color of a table cell border.
  763. ----
  764. .. _class_RichTextLabel_method_set_cell_padding:
  765. - void **set_cell_padding** **(** :ref:`Rect2<class_Rect2>` padding **)**
  766. Sets inner padding of a table cell.
  767. ----
  768. .. _class_RichTextLabel_method_set_cell_row_background_color:
  769. - void **set_cell_row_background_color** **(** :ref:`Color<class_Color>` odd_row_bg, :ref:`Color<class_Color>` even_row_bg **)**
  770. Sets color of a table cell. Separate colors for alternating rows can be specified.
  771. ----
  772. .. _class_RichTextLabel_method_set_cell_size_override:
  773. - void **set_cell_size_override** **(** :ref:`Vector2<class_Vector2>` min_size, :ref:`Vector2<class_Vector2>` max_size **)**
  774. Sets minimum and maximum size overrides for a table cell.
  775. ----
  776. .. _class_RichTextLabel_method_set_table_column_expand:
  777. - void **set_table_column_expand** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` expand, :ref:`int<class_int>` ratio **)**
  778. Edits the selected column's expansion options. If ``expand`` is ``true``, the column expands in proportion to its expansion ratio versus the other columns' ratios.
  779. For example, 2 columns with ratios 3 and 4 plus 70 pixels in available width would expand 30 and 40 pixels, respectively.
  780. If ``expand`` is ``false``, the column will not contribute to the total ratio.
  781. Theme Property Descriptions
  782. ---------------------------
  783. .. _class_RichTextLabel_theme_color_default_color:
  784. - :ref:`Color<class_Color>` **default_color**
  785. +-----------+-----------------------+
  786. | *Default* | ``Color(1, 1, 1, 1)`` |
  787. +-----------+-----------------------+
  788. The default text color.
  789. ----
  790. .. _class_RichTextLabel_theme_color_font_outline_color:
  791. - :ref:`Color<class_Color>` **font_outline_color**
  792. +-----------+-----------------------+
  793. | *Default* | ``Color(1, 1, 1, 1)`` |
  794. +-----------+-----------------------+
  795. The default tint of text outline.
  796. ----
  797. .. _class_RichTextLabel_theme_color_font_selected_color:
  798. - :ref:`Color<class_Color>` **font_selected_color**
  799. +-----------+-----------------------+
  800. | *Default* | ``Color(0, 0, 0, 1)`` |
  801. +-----------+-----------------------+
  802. The color of selected text, used when :ref:`selection_enabled<class_RichTextLabel_property_selection_enabled>` is ``true``.
  803. ----
  804. .. _class_RichTextLabel_theme_color_font_shadow_color:
  805. - :ref:`Color<class_Color>` **font_shadow_color**
  806. +-----------+-----------------------+
  807. | *Default* | ``Color(0, 0, 0, 0)`` |
  808. +-----------+-----------------------+
  809. The color of the font's shadow.
  810. ----
  811. .. _class_RichTextLabel_theme_color_selection_color:
  812. - :ref:`Color<class_Color>` **selection_color**
  813. +-----------+-----------------------------+
  814. | *Default* | ``Color(0.1, 0.1, 1, 0.8)`` |
  815. +-----------+-----------------------------+
  816. The color of the selection box.
  817. ----
  818. .. _class_RichTextLabel_theme_color_table_border:
  819. - :ref:`Color<class_Color>` **table_border**
  820. +-----------+-----------------------+
  821. | *Default* | ``Color(0, 0, 0, 0)`` |
  822. +-----------+-----------------------+
  823. The default cell border color.
  824. ----
  825. .. _class_RichTextLabel_theme_color_table_even_row_bg:
  826. - :ref:`Color<class_Color>` **table_even_row_bg**
  827. +-----------+-----------------------+
  828. | *Default* | ``Color(0, 0, 0, 0)`` |
  829. +-----------+-----------------------+
  830. The default background color for even rows.
  831. ----
  832. .. _class_RichTextLabel_theme_color_table_odd_row_bg:
  833. - :ref:`Color<class_Color>` **table_odd_row_bg**
  834. +-----------+-----------------------+
  835. | *Default* | ``Color(0, 0, 0, 0)`` |
  836. +-----------+-----------------------+
  837. The default background color for odd rows.
  838. ----
  839. .. _class_RichTextLabel_theme_constant_line_separation:
  840. - :ref:`int<class_int>` **line_separation**
  841. +-----------+-------+
  842. | *Default* | ``0`` |
  843. +-----------+-------+
  844. The vertical space between lines.
  845. ----
  846. .. _class_RichTextLabel_theme_constant_outline_size:
  847. - :ref:`int<class_int>` **outline_size**
  848. +-----------+-------+
  849. | *Default* | ``0`` |
  850. +-----------+-------+
  851. The size of the text outline.
  852. ----
  853. .. _class_RichTextLabel_theme_constant_shadow_offset_x:
  854. - :ref:`int<class_int>` **shadow_offset_x**
  855. +-----------+-------+
  856. | *Default* | ``1`` |
  857. +-----------+-------+
  858. The horizontal offset of the font's shadow.
  859. ----
  860. .. _class_RichTextLabel_theme_constant_shadow_offset_y:
  861. - :ref:`int<class_int>` **shadow_offset_y**
  862. +-----------+-------+
  863. | *Default* | ``1`` |
  864. +-----------+-------+
  865. The vertical offset of the font's shadow.
  866. ----
  867. .. _class_RichTextLabel_theme_constant_shadow_outline_size:
  868. - :ref:`int<class_int>` **shadow_outline_size**
  869. +-----------+-------+
  870. | *Default* | ``1`` |
  871. +-----------+-------+
  872. The size of the shadow outline.
  873. ----
  874. .. _class_RichTextLabel_theme_constant_table_hseparation:
  875. - :ref:`int<class_int>` **table_hseparation**
  876. +-----------+-------+
  877. | *Default* | ``3`` |
  878. +-----------+-------+
  879. The horizontal separation of elements in a table.
  880. ----
  881. .. _class_RichTextLabel_theme_constant_table_vseparation:
  882. - :ref:`int<class_int>` **table_vseparation**
  883. +-----------+-------+
  884. | *Default* | ``3`` |
  885. +-----------+-------+
  886. The vertical separation of elements in a table.
  887. ----
  888. .. _class_RichTextLabel_theme_font_bold_font:
  889. - :ref:`Font<class_Font>` **bold_font**
  890. The font used for bold text.
  891. ----
  892. .. _class_RichTextLabel_theme_font_bold_italics_font:
  893. - :ref:`Font<class_Font>` **bold_italics_font**
  894. The font used for bold italics text.
  895. ----
  896. .. _class_RichTextLabel_theme_font_italics_font:
  897. - :ref:`Font<class_Font>` **italics_font**
  898. The font used for italics text.
  899. ----
  900. .. _class_RichTextLabel_theme_font_mono_font:
  901. - :ref:`Font<class_Font>` **mono_font**
  902. The font used for monospace text.
  903. ----
  904. .. _class_RichTextLabel_theme_font_normal_font:
  905. - :ref:`Font<class_Font>` **normal_font**
  906. The default text font.
  907. ----
  908. .. _class_RichTextLabel_theme_font_size_bold_font_size:
  909. - :ref:`int<class_int>` **bold_font_size**
  910. The font size used for bold text.
  911. ----
  912. .. _class_RichTextLabel_theme_font_size_bold_italics_font_size:
  913. - :ref:`int<class_int>` **bold_italics_font_size**
  914. The font size used for bold italics text.
  915. ----
  916. .. _class_RichTextLabel_theme_font_size_italics_font_size:
  917. - :ref:`int<class_int>` **italics_font_size**
  918. The font size used for italics text.
  919. ----
  920. .. _class_RichTextLabel_theme_font_size_mono_font_size:
  921. - :ref:`int<class_int>` **mono_font_size**
  922. The font size used for monospace text.
  923. ----
  924. .. _class_RichTextLabel_theme_font_size_normal_font_size:
  925. - :ref:`int<class_int>` **normal_font_size**
  926. The default text font size.
  927. ----
  928. .. _class_RichTextLabel_theme_style_focus:
  929. - :ref:`StyleBox<class_StyleBox>` **focus**
  930. The background used when the ``RichTextLabel`` is focused. The ``focus`` :ref:`StyleBox<class_StyleBox>` is displayed *over* the base :ref:`StyleBox<class_StyleBox>`, so a partially transparent :ref:`StyleBox<class_StyleBox>` should be used to ensure the base :ref:`StyleBox<class_StyleBox>` remains visible. A :ref:`StyleBox<class_StyleBox>` that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a :ref:`StyleBoxEmpty<class_StyleBoxEmpty>` resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
  931. ----
  932. .. _class_RichTextLabel_theme_style_normal:
  933. - :ref:`StyleBox<class_StyleBox>` **normal**
  934. The normal background for the ``RichTextLabel``.
  935. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  936. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  937. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  938. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  939. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  940. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`