2
0

class_richtextlabel.rst 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/RichTextLabel.xml.
  6. .. _class_RichTextLabel:
  7. RichTextLabel
  8. =============
  9. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Label that displays rich text.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. \ **Note:** Assignments to :ref:`bbcode_text<class_RichTextLabel_property_bbcode_text>` clear the tag stack and reconstruct it from the property's contents. Any edits made to :ref:`bbcode_text<class_RichTextLabel_property_bbcode_text>` will erase previous edits made from other manual sources such as :ref:`append_bbcode<class_RichTextLabel_method_append_bbcode>` and the ``push_*`` / :ref:`pop<class_RichTextLabel_method_pop>` methods.
  16. \ **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]``.
  17. \ **Note:** ``push_*/pop`` functions won't affect BBCode.
  18. \ **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.
  19. \ **Note:** Unicode characters after ``0xffff`` (such as most emoji) are *not* supported on Windows. They will display as unknown characters instead. This will be resolved in Godot 4.0.
  20. .. rst-class:: classref-introduction-group
  21. Tutorials
  22. ---------
  23. - :doc:`BBCode in RichTextLabel <../tutorials/ui/bbcode_in_richtextlabel>`
  24. - `GUI Rich Text/BBcode Demo <https://godotengine.org/asset-library/asset/132>`__
  25. - `OS Test Demo <https://godotengine.org/asset-library/asset/677>`__
  26. .. rst-class:: classref-reftable-group
  27. Properties
  28. ----------
  29. .. table::
  30. :widths: auto
  31. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`bbcode_enabled<class_RichTextLabel_property_bbcode_enabled>` | ``false`` |
  33. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  34. | :ref:`String<class_String>` | :ref:`bbcode_text<class_RichTextLabel_property_bbcode_text>` | ``""`` |
  35. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  36. | :ref:`Array<class_Array>` | :ref:`custom_effects<class_RichTextLabel_property_custom_effects>` | ``[ ]`` |
  37. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  38. | :ref:`bool<class_bool>` | :ref:`deselect_on_focus_loss_enabled<class_RichTextLabel_property_deselect_on_focus_loss_enabled>` | ``true`` |
  39. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  40. | :ref:`bool<class_bool>` | :ref:`fit_content_height<class_RichTextLabel_property_fit_content_height>` | ``false`` |
  41. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  42. | :ref:`bool<class_bool>` | :ref:`meta_underlined<class_RichTextLabel_property_meta_underlined>` | ``true`` |
  43. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  44. | :ref:`bool<class_bool>` | :ref:`override_selected_font_color<class_RichTextLabel_property_override_selected_font_color>` | ``false`` |
  45. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  46. | :ref:`float<class_float>` | :ref:`percent_visible<class_RichTextLabel_property_percent_visible>` | ``1.0`` |
  47. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  48. | :ref:`bool<class_bool>` | rect_clip_content | ``true`` (overrides :ref:`Control<class_Control_property_rect_clip_content>`) |
  49. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  50. | :ref:`bool<class_bool>` | :ref:`scroll_active<class_RichTextLabel_property_scroll_active>` | ``true`` |
  51. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  52. | :ref:`bool<class_bool>` | :ref:`scroll_following<class_RichTextLabel_property_scroll_following>` | ``false`` |
  53. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  54. | :ref:`bool<class_bool>` | :ref:`selection_enabled<class_RichTextLabel_property_selection_enabled>` | ``false`` |
  55. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  56. | :ref:`int<class_int>` | :ref:`tab_size<class_RichTextLabel_property_tab_size>` | ``4`` |
  57. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  58. | :ref:`String<class_String>` | :ref:`text<class_RichTextLabel_property_text>` | ``""`` |
  59. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  60. | :ref:`int<class_int>` | :ref:`visible_characters<class_RichTextLabel_property_visible_characters>` | ``-1`` |
  61. +-----------------------------+----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+
  62. .. rst-class:: classref-reftable-group
  63. Methods
  64. -------
  65. .. table::
  66. :widths: auto
  67. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | void | :ref:`add_image<class_RichTextLabel_method_add_image>` **(** :ref:`Texture<class_Texture>` image, :ref:`int<class_int>` width=0, :ref:`int<class_int>` height=0, :ref:`InlineAlign<enum_RichTextLabel_InlineAlign>` align=2 **)** |
  69. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | void | :ref:`add_text<class_RichTextLabel_method_add_text>` **(** :ref:`String<class_String>` text **)** |
  71. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`append_bbcode<class_RichTextLabel_method_append_bbcode>` **(** :ref:`String<class_String>` bbcode **)** |
  73. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`clear<class_RichTextLabel_method_clear>` **(** **)** |
  75. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`deselect<class_RichTextLabel_method_deselect>` **(** **)** |
  77. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`int<class_int>` | :ref:`get_content_height<class_RichTextLabel_method_get_content_height>` **(** **)** |const| |
  79. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`int<class_int>` | :ref:`get_line_count<class_RichTextLabel_method_get_line_count>` **(** **)** |const| |
  81. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`String<class_String>` | :ref:`get_selected_text<class_RichTextLabel_method_get_selected_text>` **(** **)** |
  83. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`int<class_int>` | :ref:`get_total_character_count<class_RichTextLabel_method_get_total_character_count>` **(** **)** |const| |
  85. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`VScrollBar<class_VScrollBar>` | :ref:`get_v_scroll<class_RichTextLabel_method_get_v_scroll>` **(** **)** |
  87. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`int<class_int>` | :ref:`get_visible_line_count<class_RichTextLabel_method_get_visible_line_count>` **(** **)** |const| |
  89. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | void | :ref:`install_effect<class_RichTextLabel_method_install_effect>` **(** :ref:`Variant<class_Variant>` effect **)** |
  91. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | void | :ref:`newline<class_RichTextLabel_method_newline>` **(** **)** |
  93. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`parse_bbcode<class_RichTextLabel_method_parse_bbcode>` **(** :ref:`String<class_String>` bbcode **)** |
  95. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`Dictionary<class_Dictionary>` | :ref:`parse_expressions_for_values<class_RichTextLabel_method_parse_expressions_for_values>` **(** :ref:`PoolStringArray<class_PoolStringArray>` expressions **)** |
  97. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | void | :ref:`pop<class_RichTextLabel_method_pop>` **(** **)** |
  99. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | void | :ref:`push_align<class_RichTextLabel_method_push_align>` **(** :ref:`Align<enum_RichTextLabel_Align>` align **)** |
  101. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | void | :ref:`push_bold<class_RichTextLabel_method_push_bold>` **(** **)** |
  103. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | void | :ref:`push_bold_italics<class_RichTextLabel_method_push_bold_italics>` **(** **)** |
  105. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | void | :ref:`push_cell<class_RichTextLabel_method_push_cell>` **(** **)** |
  107. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | void | :ref:`push_color<class_RichTextLabel_method_push_color>` **(** :ref:`Color<class_Color>` color **)** |
  109. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | void | :ref:`push_font<class_RichTextLabel_method_push_font>` **(** :ref:`Font<class_Font>` font **)** |
  111. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | void | :ref:`push_indent<class_RichTextLabel_method_push_indent>` **(** :ref:`int<class_int>` level **)** |
  113. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | void | :ref:`push_italics<class_RichTextLabel_method_push_italics>` **(** **)** |
  115. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | void | :ref:`push_list<class_RichTextLabel_method_push_list>` **(** :ref:`ListType<enum_RichTextLabel_ListType>` type **)** |
  117. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | void | :ref:`push_meta<class_RichTextLabel_method_push_meta>` **(** :ref:`Variant<class_Variant>` data **)** |
  119. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | void | :ref:`push_mono<class_RichTextLabel_method_push_mono>` **(** **)** |
  121. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | void | :ref:`push_normal<class_RichTextLabel_method_push_normal>` **(** **)** |
  123. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | void | :ref:`push_strikethrough<class_RichTextLabel_method_push_strikethrough>` **(** **)** |
  125. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | void | :ref:`push_table<class_RichTextLabel_method_push_table>` **(** :ref:`int<class_int>` columns **)** |
  127. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | void | :ref:`push_underline<class_RichTextLabel_method_push_underline>` **(** **)** |
  129. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`bool<class_bool>` | :ref:`remove_line<class_RichTextLabel_method_remove_line>` **(** :ref:`int<class_int>` line **)** |
  131. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | void | :ref:`scroll_to_line<class_RichTextLabel_method_scroll_to_line>` **(** :ref:`int<class_int>` line **)** |
  133. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | 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 **)** |
  135. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. .. rst-class:: classref-reftable-group
  137. Theme Properties
  138. ----------------
  139. .. table::
  140. :widths: auto
  141. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  142. | :ref:`Color<class_Color>` | :ref:`default_color<class_RichTextLabel_theme_color_default_color>` | ``Color( 1, 1, 1, 1 )`` |
  143. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  144. | :ref:`Color<class_Color>` | :ref:`font_color_selected<class_RichTextLabel_theme_color_font_color_selected>` | ``Color( 0.49, 0.49, 0.49, 1 )`` |
  145. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  146. | :ref:`Color<class_Color>` | :ref:`font_color_shadow<class_RichTextLabel_theme_color_font_color_shadow>` | ``Color( 0, 0, 0, 0 )`` |
  147. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  148. | :ref:`Color<class_Color>` | :ref:`selection_color<class_RichTextLabel_theme_color_selection_color>` | ``Color( 0.1, 0.1, 1, 0.8 )`` |
  149. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  150. | :ref:`int<class_int>` | :ref:`line_separation<class_RichTextLabel_theme_constant_line_separation>` | ``1`` |
  151. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  152. | :ref:`int<class_int>` | :ref:`shadow_as_outline<class_RichTextLabel_theme_constant_shadow_as_outline>` | ``0`` |
  153. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  154. | :ref:`int<class_int>` | :ref:`shadow_offset_x<class_RichTextLabel_theme_constant_shadow_offset_x>` | ``1`` |
  155. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  156. | :ref:`int<class_int>` | :ref:`shadow_offset_y<class_RichTextLabel_theme_constant_shadow_offset_y>` | ``1`` |
  157. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  158. | :ref:`int<class_int>` | :ref:`table_hseparation<class_RichTextLabel_theme_constant_table_hseparation>` | ``3`` |
  159. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  160. | :ref:`int<class_int>` | :ref:`table_vseparation<class_RichTextLabel_theme_constant_table_vseparation>` | ``3`` |
  161. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  162. | :ref:`Font<class_Font>` | :ref:`bold_font<class_RichTextLabel_theme_font_bold_font>` | |
  163. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  164. | :ref:`Font<class_Font>` | :ref:`bold_italics_font<class_RichTextLabel_theme_font_bold_italics_font>` | |
  165. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  166. | :ref:`Font<class_Font>` | :ref:`italics_font<class_RichTextLabel_theme_font_italics_font>` | |
  167. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  168. | :ref:`Font<class_Font>` | :ref:`mono_font<class_RichTextLabel_theme_font_mono_font>` | |
  169. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  170. | :ref:`Font<class_Font>` | :ref:`normal_font<class_RichTextLabel_theme_font_normal_font>` | |
  171. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  172. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_RichTextLabel_theme_style_focus>` | |
  173. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  174. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_RichTextLabel_theme_style_normal>` | |
  175. +---------------------------------+---------------------------------------------------------------------------------+----------------------------------+
  176. .. rst-class:: classref-section-separator
  177. ----
  178. .. rst-class:: classref-descriptions-group
  179. Signals
  180. -------
  181. .. _class_RichTextLabel_signal_meta_clicked:
  182. .. rst-class:: classref-signal
  183. **meta_clicked** **(** :ref:`Variant<class_Variant>` meta **)**
  184. 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.
  185. .. rst-class:: classref-item-separator
  186. ----
  187. .. _class_RichTextLabel_signal_meta_hover_ended:
  188. .. rst-class:: classref-signal
  189. **meta_hover_ended** **(** :ref:`Variant<class_Variant>` meta **)**
  190. Triggers when the mouse exits a meta tag.
  191. .. rst-class:: classref-item-separator
  192. ----
  193. .. _class_RichTextLabel_signal_meta_hover_started:
  194. .. rst-class:: classref-signal
  195. **meta_hover_started** **(** :ref:`Variant<class_Variant>` meta **)**
  196. Triggers when the mouse enters a meta tag.
  197. .. rst-class:: classref-section-separator
  198. ----
  199. .. rst-class:: classref-descriptions-group
  200. Enumerations
  201. ------------
  202. .. _enum_RichTextLabel_Align:
  203. .. rst-class:: classref-enumeration
  204. enum **Align**:
  205. .. _class_RichTextLabel_constant_ALIGN_LEFT:
  206. .. rst-class:: classref-enumeration-constant
  207. :ref:`Align<enum_RichTextLabel_Align>` **ALIGN_LEFT** = ``0``
  208. Makes text left aligned.
  209. .. _class_RichTextLabel_constant_ALIGN_CENTER:
  210. .. rst-class:: classref-enumeration-constant
  211. :ref:`Align<enum_RichTextLabel_Align>` **ALIGN_CENTER** = ``1``
  212. Makes text centered.
  213. .. _class_RichTextLabel_constant_ALIGN_RIGHT:
  214. .. rst-class:: classref-enumeration-constant
  215. :ref:`Align<enum_RichTextLabel_Align>` **ALIGN_RIGHT** = ``2``
  216. Makes text right aligned.
  217. .. _class_RichTextLabel_constant_ALIGN_FILL:
  218. .. rst-class:: classref-enumeration-constant
  219. :ref:`Align<enum_RichTextLabel_Align>` **ALIGN_FILL** = ``3``
  220. Makes text fill width.
  221. .. rst-class:: classref-item-separator
  222. ----
  223. .. _enum_RichTextLabel_InlineAlign:
  224. .. rst-class:: classref-enumeration
  225. enum **InlineAlign**:
  226. .. _class_RichTextLabel_constant_INLINE_ALIGN_TOP:
  227. .. rst-class:: classref-enumeration-constant
  228. :ref:`InlineAlign<enum_RichTextLabel_InlineAlign>` **INLINE_ALIGN_TOP** = ``0``
  229. Aligns top of the inline image to the top of the text.
  230. .. _class_RichTextLabel_constant_INLINE_ALIGN_CENTER:
  231. .. rst-class:: classref-enumeration-constant
  232. :ref:`InlineAlign<enum_RichTextLabel_InlineAlign>` **INLINE_ALIGN_CENTER** = ``1``
  233. Aligns center of the inline image to the center of the text.
  234. .. _class_RichTextLabel_constant_INLINE_ALIGN_BASELINE:
  235. .. rst-class:: classref-enumeration-constant
  236. :ref:`InlineAlign<enum_RichTextLabel_InlineAlign>` **INLINE_ALIGN_BASELINE** = ``2``
  237. Aligns bottom of the inline image to the baseline of the text.
  238. .. _class_RichTextLabel_constant_INLINE_ALIGN_BOTTOM:
  239. .. rst-class:: classref-enumeration-constant
  240. :ref:`InlineAlign<enum_RichTextLabel_InlineAlign>` **INLINE_ALIGN_BOTTOM** = ``3``
  241. Aligns bottom of the inline image to the bottom of the text.
  242. .. rst-class:: classref-item-separator
  243. ----
  244. .. _enum_RichTextLabel_ListType:
  245. .. rst-class:: classref-enumeration
  246. enum **ListType**:
  247. .. _class_RichTextLabel_constant_LIST_NUMBERS:
  248. .. rst-class:: classref-enumeration-constant
  249. :ref:`ListType<enum_RichTextLabel_ListType>` **LIST_NUMBERS** = ``0``
  250. Each list item has a number marker.
  251. .. _class_RichTextLabel_constant_LIST_LETTERS:
  252. .. rst-class:: classref-enumeration-constant
  253. :ref:`ListType<enum_RichTextLabel_ListType>` **LIST_LETTERS** = ``1``
  254. Each list item has a letter marker.
  255. .. _class_RichTextLabel_constant_LIST_DOTS:
  256. .. rst-class:: classref-enumeration-constant
  257. :ref:`ListType<enum_RichTextLabel_ListType>` **LIST_DOTS** = ``2``
  258. Each list item has a filled circle marker.
  259. .. rst-class:: classref-item-separator
  260. ----
  261. .. _enum_RichTextLabel_ItemType:
  262. .. rst-class:: classref-enumeration
  263. enum **ItemType**:
  264. .. _class_RichTextLabel_constant_ITEM_FRAME:
  265. .. rst-class:: classref-enumeration-constant
  266. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_FRAME** = ``0``
  267. .. _class_RichTextLabel_constant_ITEM_TEXT:
  268. .. rst-class:: classref-enumeration-constant
  269. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_TEXT** = ``1``
  270. .. _class_RichTextLabel_constant_ITEM_IMAGE:
  271. .. rst-class:: classref-enumeration-constant
  272. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_IMAGE** = ``2``
  273. .. _class_RichTextLabel_constant_ITEM_NEWLINE:
  274. .. rst-class:: classref-enumeration-constant
  275. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_NEWLINE** = ``3``
  276. .. _class_RichTextLabel_constant_ITEM_FONT:
  277. .. rst-class:: classref-enumeration-constant
  278. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_FONT** = ``4``
  279. .. _class_RichTextLabel_constant_ITEM_COLOR:
  280. .. rst-class:: classref-enumeration-constant
  281. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_COLOR** = ``5``
  282. .. _class_RichTextLabel_constant_ITEM_UNDERLINE:
  283. .. rst-class:: classref-enumeration-constant
  284. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_UNDERLINE** = ``6``
  285. .. _class_RichTextLabel_constant_ITEM_STRIKETHROUGH:
  286. .. rst-class:: classref-enumeration-constant
  287. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_STRIKETHROUGH** = ``7``
  288. .. _class_RichTextLabel_constant_ITEM_ALIGN:
  289. .. rst-class:: classref-enumeration-constant
  290. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_ALIGN** = ``8``
  291. .. _class_RichTextLabel_constant_ITEM_INDENT:
  292. .. rst-class:: classref-enumeration-constant
  293. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_INDENT** = ``9``
  294. .. _class_RichTextLabel_constant_ITEM_LIST:
  295. .. rst-class:: classref-enumeration-constant
  296. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_LIST** = ``10``
  297. .. _class_RichTextLabel_constant_ITEM_TABLE:
  298. .. rst-class:: classref-enumeration-constant
  299. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_TABLE** = ``11``
  300. .. _class_RichTextLabel_constant_ITEM_FADE:
  301. .. rst-class:: classref-enumeration-constant
  302. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_FADE** = ``12``
  303. .. _class_RichTextLabel_constant_ITEM_SHAKE:
  304. .. rst-class:: classref-enumeration-constant
  305. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_SHAKE** = ``13``
  306. .. _class_RichTextLabel_constant_ITEM_WAVE:
  307. .. rst-class:: classref-enumeration-constant
  308. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_WAVE** = ``14``
  309. .. _class_RichTextLabel_constant_ITEM_TORNADO:
  310. .. rst-class:: classref-enumeration-constant
  311. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_TORNADO** = ``15``
  312. .. _class_RichTextLabel_constant_ITEM_RAINBOW:
  313. .. rst-class:: classref-enumeration-constant
  314. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_RAINBOW** = ``16``
  315. .. _class_RichTextLabel_constant_ITEM_CUSTOMFX:
  316. .. rst-class:: classref-enumeration-constant
  317. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_CUSTOMFX** = ``18``
  318. .. _class_RichTextLabel_constant_ITEM_META:
  319. .. rst-class:: classref-enumeration-constant
  320. :ref:`ItemType<enum_RichTextLabel_ItemType>` **ITEM_META** = ``17``
  321. .. rst-class:: classref-section-separator
  322. ----
  323. .. rst-class:: classref-descriptions-group
  324. Property Descriptions
  325. ---------------------
  326. .. _class_RichTextLabel_property_bbcode_enabled:
  327. .. rst-class:: classref-property
  328. :ref:`bool<class_bool>` **bbcode_enabled** = ``false``
  329. .. rst-class:: classref-property-setget
  330. - void **set_use_bbcode** **(** :ref:`bool<class_bool>` value **)**
  331. - :ref:`bool<class_bool>` **is_using_bbcode** **(** **)**
  332. If ``true``, the label uses BBCode formatting.
  333. \ **Note:** Trying to alter the **RichTextLabel**'s text with :ref:`add_text<class_RichTextLabel_method_add_text>` will reset this to ``false``. Use instead :ref:`append_bbcode<class_RichTextLabel_method_append_bbcode>` to preserve BBCode formatting.
  334. .. rst-class:: classref-item-separator
  335. ----
  336. .. _class_RichTextLabel_property_bbcode_text:
  337. .. rst-class:: classref-property
  338. :ref:`String<class_String>` **bbcode_text** = ``""``
  339. .. rst-class:: classref-property-setget
  340. - void **set_bbcode** **(** :ref:`String<class_String>` value **)**
  341. - :ref:`String<class_String>` **get_bbcode** **(** **)**
  342. 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.
  343. \ **Note:** It is unadvised to use the ``+=`` operator with ``bbcode_text`` (e.g. ``bbcode_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_bbcode<class_RichTextLabel_method_append_bbcode>` for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call.
  344. .. rst-class:: classref-item-separator
  345. ----
  346. .. _class_RichTextLabel_property_custom_effects:
  347. .. rst-class:: classref-property
  348. :ref:`Array<class_Array>` **custom_effects** = ``[ ]``
  349. .. rst-class:: classref-property-setget
  350. - void **set_effects** **(** :ref:`Array<class_Array>` value **)**
  351. - :ref:`Array<class_Array>` **get_effects** **(** **)**
  352. The currently installed custom effects. This is an array of :ref:`RichTextEffect<class_RichTextEffect>`\ s.
  353. To add a custom effect, it's more convenient to use :ref:`install_effect<class_RichTextLabel_method_install_effect>`.
  354. .. rst-class:: classref-item-separator
  355. ----
  356. .. _class_RichTextLabel_property_deselect_on_focus_loss_enabled:
  357. .. rst-class:: classref-property
  358. :ref:`bool<class_bool>` **deselect_on_focus_loss_enabled** = ``true``
  359. .. rst-class:: classref-property-setget
  360. - void **set_deselect_on_focus_loss_enabled** **(** :ref:`bool<class_bool>` value **)**
  361. - :ref:`bool<class_bool>` **is_deselect_on_focus_loss_enabled** **(** **)**
  362. If ``true``, the selected text will be deselected when focus is lost.
  363. .. rst-class:: classref-item-separator
  364. ----
  365. .. _class_RichTextLabel_property_fit_content_height:
  366. .. rst-class:: classref-property
  367. :ref:`bool<class_bool>` **fit_content_height** = ``false``
  368. .. rst-class:: classref-property-setget
  369. - void **set_fit_content_height** **(** :ref:`bool<class_bool>` value **)**
  370. - :ref:`bool<class_bool>` **is_fit_content_height_enabled** **(** **)**
  371. If ``true``, the label's height will be automatically updated to fit its content.
  372. \ **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.
  373. .. rst-class:: classref-item-separator
  374. ----
  375. .. _class_RichTextLabel_property_meta_underlined:
  376. .. rst-class:: classref-property
  377. :ref:`bool<class_bool>` **meta_underlined** = ``true``
  378. .. rst-class:: classref-property-setget
  379. - void **set_meta_underline** **(** :ref:`bool<class_bool>` value **)**
  380. - :ref:`bool<class_bool>` **is_meta_underlined** **(** **)**
  381. If ``true``, the label underlines meta tags such as ``[url]{text}[/url]``.
  382. .. rst-class:: classref-item-separator
  383. ----
  384. .. _class_RichTextLabel_property_override_selected_font_color:
  385. .. rst-class:: classref-property
  386. :ref:`bool<class_bool>` **override_selected_font_color** = ``false``
  387. .. rst-class:: classref-property-setget
  388. - void **set_override_selected_font_color** **(** :ref:`bool<class_bool>` value **)**
  389. - :ref:`bool<class_bool>` **is_overriding_selected_font_color** **(** **)**
  390. If ``true``, the label uses the custom font color.
  391. .. rst-class:: classref-item-separator
  392. ----
  393. .. _class_RichTextLabel_property_percent_visible:
  394. .. rst-class:: classref-property
  395. :ref:`float<class_float>` **percent_visible** = ``1.0``
  396. .. rst-class:: classref-property-setget
  397. - void **set_percent_visible** **(** :ref:`float<class_float>` value **)**
  398. - :ref:`float<class_float>` **get_percent_visible** **(** **)**
  399. 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.
  400. \ **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>`.
  401. .. rst-class:: classref-item-separator
  402. ----
  403. .. _class_RichTextLabel_property_scroll_active:
  404. .. rst-class:: classref-property
  405. :ref:`bool<class_bool>` **scroll_active** = ``true``
  406. .. rst-class:: classref-property-setget
  407. - void **set_scroll_active** **(** :ref:`bool<class_bool>` value **)**
  408. - :ref:`bool<class_bool>` **is_scroll_active** **(** **)**
  409. 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>`.
  410. .. rst-class:: classref-item-separator
  411. ----
  412. .. _class_RichTextLabel_property_scroll_following:
  413. .. rst-class:: classref-property
  414. :ref:`bool<class_bool>` **scroll_following** = ``false``
  415. .. rst-class:: classref-property-setget
  416. - void **set_scroll_follow** **(** :ref:`bool<class_bool>` value **)**
  417. - :ref:`bool<class_bool>` **is_scroll_following** **(** **)**
  418. If ``true``, the window scrolls down to display new content automatically.
  419. .. rst-class:: classref-item-separator
  420. ----
  421. .. _class_RichTextLabel_property_selection_enabled:
  422. .. rst-class:: classref-property
  423. :ref:`bool<class_bool>` **selection_enabled** = ``false``
  424. .. rst-class:: classref-property-setget
  425. - void **set_selection_enabled** **(** :ref:`bool<class_bool>` value **)**
  426. - :ref:`bool<class_bool>` **is_selection_enabled** **(** **)**
  427. If ``true``, the label allows text selection.
  428. .. rst-class:: classref-item-separator
  429. ----
  430. .. _class_RichTextLabel_property_tab_size:
  431. .. rst-class:: classref-property
  432. :ref:`int<class_int>` **tab_size** = ``4``
  433. .. rst-class:: classref-property-setget
  434. - void **set_tab_size** **(** :ref:`int<class_int>` value **)**
  435. - :ref:`int<class_int>` **get_tab_size** **(** **)**
  436. The number of spaces associated with a single tab length. Does not affect ``\t`` in text tags, only indent tags.
  437. .. rst-class:: classref-item-separator
  438. ----
  439. .. _class_RichTextLabel_property_text:
  440. .. rst-class:: classref-property
  441. :ref:`String<class_String>` **text** = ``""``
  442. .. rst-class:: classref-property-setget
  443. - void **set_text** **(** :ref:`String<class_String>` value **)**
  444. - :ref:`String<class_String>` **get_text** **(** **)**
  445. The raw text of the label.
  446. When set, clears the tag stack and adds a raw text tag to the top of it. Does not parse BBCodes. Does not modify :ref:`bbcode_text<class_RichTextLabel_property_bbcode_text>`.
  447. .. rst-class:: classref-item-separator
  448. ----
  449. .. _class_RichTextLabel_property_visible_characters:
  450. .. rst-class:: classref-property
  451. :ref:`int<class_int>` **visible_characters** = ``-1``
  452. .. rst-class:: classref-property-setget
  453. - void **set_visible_characters** **(** :ref:`int<class_int>` value **)**
  454. - :ref:`int<class_int>` **get_visible_characters** **(** **)**
  455. The restricted number of characters to display in the label. If ``-1``, all characters will be displayed.
  456. \ **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>`.
  457. .. rst-class:: classref-section-separator
  458. ----
  459. .. rst-class:: classref-descriptions-group
  460. Method Descriptions
  461. -------------------
  462. .. _class_RichTextLabel_method_add_image:
  463. .. rst-class:: classref-method
  464. void **add_image** **(** :ref:`Texture<class_Texture>` image, :ref:`int<class_int>` width=0, :ref:`int<class_int>` height=0, :ref:`InlineAlign<enum_RichTextLabel_InlineAlign>` align=2 **)**
  465. Adds an image's opening and closing tags to the tag stack, optionally providing a ``width`` and ``height`` to resize the image.
  466. If ``width`` or ``height`` is set to 0, the image size will be adjusted in order to keep the original aspect ratio.
  467. .. rst-class:: classref-item-separator
  468. ----
  469. .. _class_RichTextLabel_method_add_text:
  470. .. rst-class:: classref-method
  471. void **add_text** **(** :ref:`String<class_String>` text **)**
  472. Adds raw non-BBCode-parsed text to the tag stack.
  473. .. rst-class:: classref-item-separator
  474. ----
  475. .. _class_RichTextLabel_method_append_bbcode:
  476. .. rst-class:: classref-method
  477. :ref:`Error<enum_@GlobalScope_Error>` **append_bbcode** **(** :ref:`String<class_String>` bbcode **)**
  478. Parses ``bbcode`` and adds tags to the tag stack as needed.
  479. \ **Note:** Using this method, you can't close a tag that was opened in a previous :ref:`append_bbcode<class_RichTextLabel_method_append_bbcode>` 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:`bbcode_text<class_RichTextLabel_property_bbcode_text>` instead of using :ref:`append_bbcode<class_RichTextLabel_method_append_bbcode>`.
  480. \ **Note:** This method internals' can't possibly fail, but an error code is returned for backwards compatibility, which will always be :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>`.
  481. .. rst-class:: classref-item-separator
  482. ----
  483. .. _class_RichTextLabel_method_clear:
  484. .. rst-class:: classref-method
  485. void **clear** **(** **)**
  486. Clears the tag stack and sets :ref:`bbcode_text<class_RichTextLabel_property_bbcode_text>` to an empty string.
  487. .. rst-class:: classref-item-separator
  488. ----
  489. .. _class_RichTextLabel_method_deselect:
  490. .. rst-class:: classref-method
  491. void **deselect** **(** **)**
  492. Clears the current selection.
  493. .. rst-class:: classref-item-separator
  494. ----
  495. .. _class_RichTextLabel_method_get_content_height:
  496. .. rst-class:: classref-method
  497. :ref:`int<class_int>` **get_content_height** **(** **)** |const|
  498. Returns the height of the content.
  499. .. rst-class:: classref-item-separator
  500. ----
  501. .. _class_RichTextLabel_method_get_line_count:
  502. .. rst-class:: classref-method
  503. :ref:`int<class_int>` **get_line_count** **(** **)** |const|
  504. Returns the total number of newlines in the tag stack's text tags. Considers wrapped text as one line.
  505. .. rst-class:: classref-item-separator
  506. ----
  507. .. _class_RichTextLabel_method_get_selected_text:
  508. .. rst-class:: classref-method
  509. :ref:`String<class_String>` **get_selected_text** **(** **)**
  510. Returns the current selection text. Does not include BBCodes.
  511. .. rst-class:: classref-item-separator
  512. ----
  513. .. _class_RichTextLabel_method_get_total_character_count:
  514. .. rst-class:: classref-method
  515. :ref:`int<class_int>` **get_total_character_count** **(** **)** |const|
  516. Returns the total number of characters from text tags. Does not include BBCodes.
  517. .. rst-class:: classref-item-separator
  518. ----
  519. .. _class_RichTextLabel_method_get_v_scroll:
  520. .. rst-class:: classref-method
  521. :ref:`VScrollBar<class_VScrollBar>` **get_v_scroll** **(** **)**
  522. Returns the vertical scrollbar.
  523. \ **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.
  524. .. rst-class:: classref-item-separator
  525. ----
  526. .. _class_RichTextLabel_method_get_visible_line_count:
  527. .. rst-class:: classref-method
  528. :ref:`int<class_int>` **get_visible_line_count** **(** **)** |const|
  529. Returns the number of visible lines.
  530. .. rst-class:: classref-item-separator
  531. ----
  532. .. _class_RichTextLabel_method_install_effect:
  533. .. rst-class:: classref-method
  534. void **install_effect** **(** :ref:`Variant<class_Variant>` effect **)**
  535. Installs a custom effect. ``effect`` should be a valid :ref:`RichTextEffect<class_RichTextEffect>`.
  536. .. rst-class:: classref-item-separator
  537. ----
  538. .. _class_RichTextLabel_method_newline:
  539. .. rst-class:: classref-method
  540. void **newline** **(** **)**
  541. Adds a newline tag to the tag stack.
  542. .. rst-class:: classref-item-separator
  543. ----
  544. .. _class_RichTextLabel_method_parse_bbcode:
  545. .. rst-class:: classref-method
  546. :ref:`Error<enum_@GlobalScope_Error>` **parse_bbcode** **(** :ref:`String<class_String>` bbcode **)**
  547. The assignment version of :ref:`append_bbcode<class_RichTextLabel_method_append_bbcode>`. Clears the tag stack and inserts the new content.
  548. \ **Note:** This method internals' can't possibly fail, but an error code is returned for backwards compatibility, which will always be :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>`.
  549. .. rst-class:: classref-item-separator
  550. ----
  551. .. _class_RichTextLabel_method_parse_expressions_for_values:
  552. .. rst-class:: classref-method
  553. :ref:`Dictionary<class_Dictionary>` **parse_expressions_for_values** **(** :ref:`PoolStringArray<class_PoolStringArray>` expressions **)**
  554. Parses BBCode parameter ``expressions`` into a dictionary.
  555. .. rst-class:: classref-item-separator
  556. ----
  557. .. _class_RichTextLabel_method_pop:
  558. .. rst-class:: classref-method
  559. void **pop** **(** **)**
  560. Terminates the current tag. Use after ``push_*`` methods to close BBCodes manually. Does not need to follow ``add_*`` methods.
  561. .. rst-class:: classref-item-separator
  562. ----
  563. .. _class_RichTextLabel_method_push_align:
  564. .. rst-class:: classref-method
  565. void **push_align** **(** :ref:`Align<enum_RichTextLabel_Align>` align **)**
  566. Adds an ``[align]`` tag based on the given ``align`` value. See :ref:`Align<enum_RichTextLabel_Align>` for possible values.
  567. .. rst-class:: classref-item-separator
  568. ----
  569. .. _class_RichTextLabel_method_push_bold:
  570. .. rst-class:: classref-method
  571. void **push_bold** **(** **)**
  572. 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.
  573. .. rst-class:: classref-item-separator
  574. ----
  575. .. _class_RichTextLabel_method_push_bold_italics:
  576. .. rst-class:: classref-method
  577. void **push_bold_italics** **(** **)**
  578. Adds a ``[font]`` tag with a bold italics font to the tag stack.
  579. .. rst-class:: classref-item-separator
  580. ----
  581. .. _class_RichTextLabel_method_push_cell:
  582. .. rst-class:: classref-method
  583. void **push_cell** **(** **)**
  584. 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.
  585. .. rst-class:: classref-item-separator
  586. ----
  587. .. _class_RichTextLabel_method_push_color:
  588. .. rst-class:: classref-method
  589. void **push_color** **(** :ref:`Color<class_Color>` color **)**
  590. Adds a ``[color]`` tag to the tag stack.
  591. .. rst-class:: classref-item-separator
  592. ----
  593. .. _class_RichTextLabel_method_push_font:
  594. .. rst-class:: classref-method
  595. void **push_font** **(** :ref:`Font<class_Font>` font **)**
  596. Adds a ``[font]`` tag to the tag stack. Overrides default fonts for its duration.
  597. .. rst-class:: classref-item-separator
  598. ----
  599. .. _class_RichTextLabel_method_push_indent:
  600. .. rst-class:: classref-method
  601. void **push_indent** **(** :ref:`int<class_int>` level **)**
  602. 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.
  603. .. rst-class:: classref-item-separator
  604. ----
  605. .. _class_RichTextLabel_method_push_italics:
  606. .. rst-class:: classref-method
  607. void **push_italics** **(** **)**
  608. 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.
  609. .. rst-class:: classref-item-separator
  610. ----
  611. .. _class_RichTextLabel_method_push_list:
  612. .. rst-class:: classref-method
  613. void **push_list** **(** :ref:`ListType<enum_RichTextLabel_ListType>` type **)**
  614. Adds a ``[list]`` tag to the tag stack. Similar to the BBCodes ``[ol]`` or ``[ul]``, but supports more list types. Not fully implemented!
  615. .. rst-class:: classref-item-separator
  616. ----
  617. .. _class_RichTextLabel_method_push_meta:
  618. .. rst-class:: classref-method
  619. void **push_meta** **(** :ref:`Variant<class_Variant>` data **)**
  620. 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.
  621. .. rst-class:: classref-item-separator
  622. ----
  623. .. _class_RichTextLabel_method_push_mono:
  624. .. rst-class:: classref-method
  625. void **push_mono** **(** **)**
  626. Adds a ``[font]`` tag with a monospace font to the tag stack.
  627. .. rst-class:: classref-item-separator
  628. ----
  629. .. _class_RichTextLabel_method_push_normal:
  630. .. rst-class:: classref-method
  631. void **push_normal** **(** **)**
  632. Adds a ``[font]`` tag with a normal font to the tag stack.
  633. .. rst-class:: classref-item-separator
  634. ----
  635. .. _class_RichTextLabel_method_push_strikethrough:
  636. .. rst-class:: classref-method
  637. void **push_strikethrough** **(** **)**
  638. Adds a ``[s]`` tag to the tag stack.
  639. .. rst-class:: classref-item-separator
  640. ----
  641. .. _class_RichTextLabel_method_push_table:
  642. .. rst-class:: classref-method
  643. void **push_table** **(** :ref:`int<class_int>` columns **)**
  644. Adds a ``[table=columns]`` tag to the tag stack.
  645. .. rst-class:: classref-item-separator
  646. ----
  647. .. _class_RichTextLabel_method_push_underline:
  648. .. rst-class:: classref-method
  649. void **push_underline** **(** **)**
  650. Adds a ``[u]`` tag to the tag stack.
  651. .. rst-class:: classref-item-separator
  652. ----
  653. .. _class_RichTextLabel_method_remove_line:
  654. .. rst-class:: classref-method
  655. :ref:`bool<class_bool>` **remove_line** **(** :ref:`int<class_int>` line **)**
  656. Removes a line of content from the label. Returns ``true`` if the line exists.
  657. The ``line`` argument is the index of the line to remove, it can take values in the interval ``[0, get_line_count() - 1]``.
  658. .. rst-class:: classref-item-separator
  659. ----
  660. .. _class_RichTextLabel_method_scroll_to_line:
  661. .. rst-class:: classref-method
  662. void **scroll_to_line** **(** :ref:`int<class_int>` line **)**
  663. Scrolls the window's top line to match ``line``.
  664. .. rst-class:: classref-item-separator
  665. ----
  666. .. _class_RichTextLabel_method_set_table_column_expand:
  667. .. rst-class:: classref-method
  668. void **set_table_column_expand** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` expand, :ref:`int<class_int>` ratio **)**
  669. 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.
  670. For example, 2 columns with ratios 3 and 4 plus 70 pixels in available width would expand 30 and 40 pixels, respectively.
  671. If ``expand`` is ``false``, the column will not contribute to the total ratio.
  672. .. rst-class:: classref-section-separator
  673. ----
  674. .. rst-class:: classref-descriptions-group
  675. Theme Property Descriptions
  676. ---------------------------
  677. .. _class_RichTextLabel_theme_color_default_color:
  678. .. rst-class:: classref-themeproperty
  679. :ref:`Color<class_Color>` **default_color** = ``Color( 1, 1, 1, 1 )``
  680. The default text color.
  681. .. rst-class:: classref-item-separator
  682. ----
  683. .. _class_RichTextLabel_theme_color_font_color_selected:
  684. .. rst-class:: classref-themeproperty
  685. :ref:`Color<class_Color>` **font_color_selected** = ``Color( 0.49, 0.49, 0.49, 1 )``
  686. The color of selected text, used when :ref:`selection_enabled<class_RichTextLabel_property_selection_enabled>` is ``true``.
  687. .. rst-class:: classref-item-separator
  688. ----
  689. .. _class_RichTextLabel_theme_color_font_color_shadow:
  690. .. rst-class:: classref-themeproperty
  691. :ref:`Color<class_Color>` **font_color_shadow** = ``Color( 0, 0, 0, 0 )``
  692. The color of the font's shadow.
  693. .. rst-class:: classref-item-separator
  694. ----
  695. .. _class_RichTextLabel_theme_color_selection_color:
  696. .. rst-class:: classref-themeproperty
  697. :ref:`Color<class_Color>` **selection_color** = ``Color( 0.1, 0.1, 1, 0.8 )``
  698. The color of the selection box.
  699. .. rst-class:: classref-item-separator
  700. ----
  701. .. _class_RichTextLabel_theme_constant_line_separation:
  702. .. rst-class:: classref-themeproperty
  703. :ref:`int<class_int>` **line_separation** = ``1``
  704. The vertical space between lines.
  705. .. rst-class:: classref-item-separator
  706. ----
  707. .. _class_RichTextLabel_theme_constant_shadow_as_outline:
  708. .. rst-class:: classref-themeproperty
  709. :ref:`int<class_int>` **shadow_as_outline** = ``0``
  710. Boolean value. If 1 (``true``), the shadow will be displayed around the whole text as an outline.
  711. .. rst-class:: classref-item-separator
  712. ----
  713. .. _class_RichTextLabel_theme_constant_shadow_offset_x:
  714. .. rst-class:: classref-themeproperty
  715. :ref:`int<class_int>` **shadow_offset_x** = ``1``
  716. The horizontal offset of the font's shadow.
  717. .. rst-class:: classref-item-separator
  718. ----
  719. .. _class_RichTextLabel_theme_constant_shadow_offset_y:
  720. .. rst-class:: classref-themeproperty
  721. :ref:`int<class_int>` **shadow_offset_y** = ``1``
  722. The vertical offset of the font's shadow.
  723. .. rst-class:: classref-item-separator
  724. ----
  725. .. _class_RichTextLabel_theme_constant_table_hseparation:
  726. .. rst-class:: classref-themeproperty
  727. :ref:`int<class_int>` **table_hseparation** = ``3``
  728. The horizontal separation of elements in a table.
  729. .. rst-class:: classref-item-separator
  730. ----
  731. .. _class_RichTextLabel_theme_constant_table_vseparation:
  732. .. rst-class:: classref-themeproperty
  733. :ref:`int<class_int>` **table_vseparation** = ``3``
  734. The vertical separation of elements in a table.
  735. .. rst-class:: classref-item-separator
  736. ----
  737. .. _class_RichTextLabel_theme_font_bold_font:
  738. .. rst-class:: classref-themeproperty
  739. :ref:`Font<class_Font>` **bold_font**
  740. The font used for bold text.
  741. .. rst-class:: classref-item-separator
  742. ----
  743. .. _class_RichTextLabel_theme_font_bold_italics_font:
  744. .. rst-class:: classref-themeproperty
  745. :ref:`Font<class_Font>` **bold_italics_font**
  746. The font used for bold italics text.
  747. .. rst-class:: classref-item-separator
  748. ----
  749. .. _class_RichTextLabel_theme_font_italics_font:
  750. .. rst-class:: classref-themeproperty
  751. :ref:`Font<class_Font>` **italics_font**
  752. The font used for italics text.
  753. .. rst-class:: classref-item-separator
  754. ----
  755. .. _class_RichTextLabel_theme_font_mono_font:
  756. .. rst-class:: classref-themeproperty
  757. :ref:`Font<class_Font>` **mono_font**
  758. The font used for monospace text.
  759. .. rst-class:: classref-item-separator
  760. ----
  761. .. _class_RichTextLabel_theme_font_normal_font:
  762. .. rst-class:: classref-themeproperty
  763. :ref:`Font<class_Font>` **normal_font**
  764. The default text font.
  765. .. rst-class:: classref-item-separator
  766. ----
  767. .. _class_RichTextLabel_theme_style_focus:
  768. .. rst-class:: classref-themeproperty
  769. :ref:`StyleBox<class_StyleBox>` **focus**
  770. The background used when the **RichTextLabel** is focused.
  771. .. rst-class:: classref-item-separator
  772. ----
  773. .. _class_RichTextLabel_theme_style_normal:
  774. .. rst-class:: classref-themeproperty
  775. :ref:`StyleBox<class_StyleBox>` **normal**
  776. The normal background for the **RichTextLabel**.
  777. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  778. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  779. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  780. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`