class_richtextlabel.rst 164 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/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. A control for displaying text that can contain different font styles, images, and basic formatting.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A control for displaying text that can contain custom fonts, images, and basic formatting. **RichTextLabel** manages these as an internal tag stack. It also adapts itself to given width/heights.
  15. \ **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.
  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<class_RichTextLabel_property_fit_content>` property.
  19. .. rst-class:: classref-introduction-group
  20. Tutorials
  21. ---------
  22. - :doc:`BBCode in RichTextLabel <../tutorials/ui/bbcode_in_richtextlabel>`
  23. - `GUI Rich Text/BBcode Demo <https://godotengine.org/asset-library/asset/132>`__
  24. - `OS Test Demo <https://godotengine.org/asset-library/asset/677>`__
  25. .. rst-class:: classref-reftable-group
  26. Properties
  27. ----------
  28. .. table::
  29. :widths: auto
  30. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  31. | :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` | :ref:`autowrap_mode<class_RichTextLabel_property_autowrap_mode>` | ``3`` |
  32. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`bbcode_enabled<class_RichTextLabel_property_bbcode_enabled>` | ``false`` |
  34. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | clip_contents | ``true`` (overrides :ref:`Control<class_Control_property_clip_contents>`) |
  36. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`context_menu_enabled<class_RichTextLabel_property_context_menu_enabled>` | ``false`` |
  38. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  39. | :ref:`Array<class_Array>` | :ref:`custom_effects<class_RichTextLabel_property_custom_effects>` | ``[]`` |
  40. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`deselect_on_focus_loss_enabled<class_RichTextLabel_property_deselect_on_focus_loss_enabled>` | ``true`` |
  42. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`drag_and_drop_selection_enabled<class_RichTextLabel_property_drag_and_drop_selection_enabled>` | ``true`` |
  44. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  45. | :ref:`bool<class_bool>` | :ref:`fit_content<class_RichTextLabel_property_fit_content>` | ``false`` |
  46. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`hint_underlined<class_RichTextLabel_property_hint_underlined>` | ``true`` |
  48. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  49. | :ref:`String<class_String>` | :ref:`language<class_RichTextLabel_property_language>` | ``""`` |
  50. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  51. | :ref:`bool<class_bool>` | :ref:`meta_underlined<class_RichTextLabel_property_meta_underlined>` | ``true`` |
  52. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  53. | :ref:`int<class_int>` | :ref:`progress_bar_delay<class_RichTextLabel_property_progress_bar_delay>` | ``1000`` |
  54. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  55. | :ref:`bool<class_bool>` | :ref:`scroll_active<class_RichTextLabel_property_scroll_active>` | ``true`` |
  56. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  57. | :ref:`bool<class_bool>` | :ref:`scroll_following<class_RichTextLabel_property_scroll_following>` | ``false`` |
  58. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  59. | :ref:`bool<class_bool>` | :ref:`selection_enabled<class_RichTextLabel_property_selection_enabled>` | ``false`` |
  60. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  61. | :ref:`bool<class_bool>` | :ref:`shortcut_keys_enabled<class_RichTextLabel_property_shortcut_keys_enabled>` | ``true`` |
  62. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  63. | :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` | :ref:`structured_text_bidi_override<class_RichTextLabel_property_structured_text_bidi_override>` | ``0`` |
  64. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  65. | :ref:`Array<class_Array>` | :ref:`structured_text_bidi_override_options<class_RichTextLabel_property_structured_text_bidi_override_options>` | ``[]`` |
  66. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  67. | :ref:`int<class_int>` | :ref:`tab_size<class_RichTextLabel_property_tab_size>` | ``4`` |
  68. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  69. | :ref:`String<class_String>` | :ref:`text<class_RichTextLabel_property_text>` | ``""`` |
  70. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  71. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`text_direction<class_RichTextLabel_property_text_direction>` | ``0`` |
  72. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  73. | :ref:`bool<class_bool>` | :ref:`threaded<class_RichTextLabel_property_threaded>` | ``false`` |
  74. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  75. | :ref:`int<class_int>` | :ref:`visible_characters<class_RichTextLabel_property_visible_characters>` | ``-1`` |
  76. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  77. | :ref:`VisibleCharactersBehavior<enum_TextServer_VisibleCharactersBehavior>` | :ref:`visible_characters_behavior<class_RichTextLabel_property_visible_characters_behavior>` | ``0`` |
  78. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  79. | :ref:`float<class_float>` | :ref:`visible_ratio<class_RichTextLabel_property_visible_ratio>` | ``1.0`` |
  80. +-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  81. .. rst-class:: classref-reftable-group
  82. Methods
  83. -------
  84. .. table::
  85. :widths: auto
  86. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | 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, :ref:`Rect2<class_Rect2>` region=Rect2(0, 0, 0, 0), :ref:`Variant<class_Variant>` key=null, :ref:`bool<class_bool>` pad=false, :ref:`String<class_String>` tooltip="", :ref:`bool<class_bool>` size_in_percent=false **)** |
  88. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`add_text<class_RichTextLabel_method_add_text>` **(** :ref:`String<class_String>` text **)** |
  90. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`append_text<class_RichTextLabel_method_append_text>` **(** :ref:`String<class_String>` bbcode **)** |
  92. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | void | :ref:`clear<class_RichTextLabel_method_clear>` **(** **)** |
  94. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | void | :ref:`deselect<class_RichTextLabel_method_deselect>` **(** **)** |
  96. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`int<class_int>` | :ref:`get_character_line<class_RichTextLabel_method_get_character_line>` **(** :ref:`int<class_int>` character **)** |
  98. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`int<class_int>` | :ref:`get_character_paragraph<class_RichTextLabel_method_get_character_paragraph>` **(** :ref:`int<class_int>` character **)** |
  100. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`int<class_int>` | :ref:`get_content_height<class_RichTextLabel_method_get_content_height>` **(** **)** |const| |
  102. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`int<class_int>` | :ref:`get_content_width<class_RichTextLabel_method_get_content_width>` **(** **)** |const| |
  104. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`int<class_int>` | :ref:`get_line_count<class_RichTextLabel_method_get_line_count>` **(** **)** |const| |
  106. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`float<class_float>` | :ref:`get_line_offset<class_RichTextLabel_method_get_line_offset>` **(** :ref:`int<class_int>` line **)** |
  108. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_menu<class_RichTextLabel_method_get_menu>` **(** **)** |const| |
  110. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`int<class_int>` | :ref:`get_paragraph_count<class_RichTextLabel_method_get_paragraph_count>` **(** **)** |const| |
  112. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`float<class_float>` | :ref:`get_paragraph_offset<class_RichTextLabel_method_get_paragraph_offset>` **(** :ref:`int<class_int>` paragraph **)** |
  114. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`String<class_String>` | :ref:`get_parsed_text<class_RichTextLabel_method_get_parsed_text>` **(** **)** |const| |
  116. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`String<class_String>` | :ref:`get_selected_text<class_RichTextLabel_method_get_selected_text>` **(** **)** |const| |
  118. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`int<class_int>` | :ref:`get_selection_from<class_RichTextLabel_method_get_selection_from>` **(** **)** |const| |
  120. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`int<class_int>` | :ref:`get_selection_to<class_RichTextLabel_method_get_selection_to>` **(** **)** |const| |
  122. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`int<class_int>` | :ref:`get_total_character_count<class_RichTextLabel_method_get_total_character_count>` **(** **)** |const| |
  124. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`VScrollBar<class_VScrollBar>` | :ref:`get_v_scroll_bar<class_RichTextLabel_method_get_v_scroll_bar>` **(** **)** |
  126. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`int<class_int>` | :ref:`get_visible_line_count<class_RichTextLabel_method_get_visible_line_count>` **(** **)** |const| |
  128. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :ref:`int<class_int>` | :ref:`get_visible_paragraph_count<class_RichTextLabel_method_get_visible_paragraph_count>` **(** **)** |const| |
  130. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | void | :ref:`install_effect<class_RichTextLabel_method_install_effect>` **(** :ref:`Variant<class_Variant>` effect **)** |
  132. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | :ref:`bool<class_bool>` | :ref:`is_menu_visible<class_RichTextLabel_method_is_menu_visible>` **(** **)** |const| |
  134. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | :ref:`bool<class_bool>` | :ref:`is_ready<class_RichTextLabel_method_is_ready>` **(** **)** |const| |
  136. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | void | :ref:`menu_option<class_RichTextLabel_method_menu_option>` **(** :ref:`int<class_int>` option **)** |
  138. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | void | :ref:`newline<class_RichTextLabel_method_newline>` **(** **)** |
  140. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | void | :ref:`parse_bbcode<class_RichTextLabel_method_parse_bbcode>` **(** :ref:`String<class_String>` bbcode **)** |
  142. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | :ref:`Dictionary<class_Dictionary>` | :ref:`parse_expressions_for_values<class_RichTextLabel_method_parse_expressions_for_values>` **(** :ref:`PackedStringArray<class_PackedStringArray>` expressions **)** |
  144. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | void | :ref:`pop<class_RichTextLabel_method_pop>` **(** **)** |
  146. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | void | :ref:`pop_all<class_RichTextLabel_method_pop_all>` **(** **)** |
  148. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | void | :ref:`pop_context<class_RichTextLabel_method_pop_context>` **(** **)** |
  150. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | void | :ref:`push_bgcolor<class_RichTextLabel_method_push_bgcolor>` **(** :ref:`Color<class_Color>` bgcolor **)** |
  152. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | void | :ref:`push_bold<class_RichTextLabel_method_push_bold>` **(** **)** |
  154. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | void | :ref:`push_bold_italics<class_RichTextLabel_method_push_bold_italics>` **(** **)** |
  156. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | void | :ref:`push_cell<class_RichTextLabel_method_push_cell>` **(** **)** |
  158. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | void | :ref:`push_color<class_RichTextLabel_method_push_color>` **(** :ref:`Color<class_Color>` color **)** |
  160. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | void | :ref:`push_context<class_RichTextLabel_method_push_context>` **(** **)** |
  162. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | void | :ref:`push_customfx<class_RichTextLabel_method_push_customfx>` **(** :ref:`RichTextEffect<class_RichTextEffect>` effect, :ref:`Dictionary<class_Dictionary>` env **)** |
  164. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | 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) **)** |
  166. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | void | :ref:`push_fgcolor<class_RichTextLabel_method_push_fgcolor>` **(** :ref:`Color<class_Color>` fgcolor **)** |
  168. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | void | :ref:`push_font<class_RichTextLabel_method_push_font>` **(** :ref:`Font<class_Font>` font, :ref:`int<class_int>` font_size=0 **)** |
  170. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | void | :ref:`push_font_size<class_RichTextLabel_method_push_font_size>` **(** :ref:`int<class_int>` font_size **)** |
  172. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | void | :ref:`push_hint<class_RichTextLabel_method_push_hint>` **(** :ref:`String<class_String>` description **)** |
  174. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | void | :ref:`push_indent<class_RichTextLabel_method_push_indent>` **(** :ref:`int<class_int>` level **)** |
  176. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | void | :ref:`push_italics<class_RichTextLabel_method_push_italics>` **(** **)** |
  178. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | void | :ref:`push_language<class_RichTextLabel_method_push_language>` **(** :ref:`String<class_String>` language **)** |
  180. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. | 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, :ref:`String<class_String>` bullet="•" **)** |
  182. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. | void | :ref:`push_meta<class_RichTextLabel_method_push_meta>` **(** :ref:`Variant<class_Variant>` data **)** |
  184. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  185. | void | :ref:`push_mono<class_RichTextLabel_method_push_mono>` **(** **)** |
  186. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  187. | void | :ref:`push_normal<class_RichTextLabel_method_push_normal>` **(** **)** |
  188. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  189. | void | :ref:`push_outline_color<class_RichTextLabel_method_push_outline_color>` **(** :ref:`Color<class_Color>` color **)** |
  190. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  191. | void | :ref:`push_outline_size<class_RichTextLabel_method_push_outline_size>` **(** :ref:`int<class_int>` outline_size **)** |
  192. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  193. | 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_TextServer_StructuredTextParser>` st_parser=0, |bitfield|\<:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\> justification_flags=163, :ref:`PackedFloat32Array<class_PackedFloat32Array>` tab_stops=PackedFloat32Array() **)** |
  194. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  195. | void | :ref:`push_strikethrough<class_RichTextLabel_method_push_strikethrough>` **(** **)** |
  196. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  197. | void | :ref:`push_table<class_RichTextLabel_method_push_table>` **(** :ref:`int<class_int>` columns, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=0, :ref:`int<class_int>` align_to_row=-1 **)** |
  198. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  199. | void | :ref:`push_underline<class_RichTextLabel_method_push_underline>` **(** **)** |
  200. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  201. | :ref:`bool<class_bool>` | :ref:`remove_paragraph<class_RichTextLabel_method_remove_paragraph>` **(** :ref:`int<class_int>` paragraph **)** |
  202. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  203. | void | :ref:`scroll_to_line<class_RichTextLabel_method_scroll_to_line>` **(** :ref:`int<class_int>` line **)** |
  204. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  205. | void | :ref:`scroll_to_paragraph<class_RichTextLabel_method_scroll_to_paragraph>` **(** :ref:`int<class_int>` paragraph **)** |
  206. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  207. | void | :ref:`scroll_to_selection<class_RichTextLabel_method_scroll_to_selection>` **(** **)** |
  208. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  209. | void | :ref:`select_all<class_RichTextLabel_method_select_all>` **(** **)** |
  210. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  211. | void | :ref:`set_cell_border_color<class_RichTextLabel_method_set_cell_border_color>` **(** :ref:`Color<class_Color>` color **)** |
  212. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  213. | void | :ref:`set_cell_padding<class_RichTextLabel_method_set_cell_padding>` **(** :ref:`Rect2<class_Rect2>` padding **)** |
  214. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  215. | 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 **)** |
  216. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  217. | 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 **)** |
  218. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  219. | 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=1 **)** |
  220. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  221. | void | :ref:`update_image<class_RichTextLabel_method_update_image>` **(** :ref:`Variant<class_Variant>` key, |bitfield|\<:ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>`\> mask, :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, :ref:`Rect2<class_Rect2>` region=Rect2(0, 0, 0, 0), :ref:`bool<class_bool>` pad=false, :ref:`String<class_String>` tooltip="", :ref:`bool<class_bool>` size_in_percent=false **)** |
  222. +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  223. .. rst-class:: classref-reftable-group
  224. Theme Properties
  225. ----------------
  226. .. table::
  227. :widths: auto
  228. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  229. | :ref:`Color<class_Color>` | :ref:`default_color<class_RichTextLabel_theme_color_default_color>` | ``Color(1, 1, 1, 1)`` |
  230. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  231. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_RichTextLabel_theme_color_font_outline_color>` | ``Color(1, 1, 1, 1)`` |
  232. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  233. | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_RichTextLabel_theme_color_font_selected_color>` | ``Color(0, 0, 0, 0)`` |
  234. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  235. | :ref:`Color<class_Color>` | :ref:`font_shadow_color<class_RichTextLabel_theme_color_font_shadow_color>` | ``Color(0, 0, 0, 0)`` |
  236. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  237. | :ref:`Color<class_Color>` | :ref:`selection_color<class_RichTextLabel_theme_color_selection_color>` | ``Color(0.1, 0.1, 1, 0.8)`` |
  238. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  239. | :ref:`Color<class_Color>` | :ref:`table_border<class_RichTextLabel_theme_color_table_border>` | ``Color(0, 0, 0, 0)`` |
  240. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  241. | :ref:`Color<class_Color>` | :ref:`table_even_row_bg<class_RichTextLabel_theme_color_table_even_row_bg>` | ``Color(0, 0, 0, 0)`` |
  242. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  243. | :ref:`Color<class_Color>` | :ref:`table_odd_row_bg<class_RichTextLabel_theme_color_table_odd_row_bg>` | ``Color(0, 0, 0, 0)`` |
  244. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  245. | :ref:`int<class_int>` | :ref:`line_separation<class_RichTextLabel_theme_constant_line_separation>` | ``0`` |
  246. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  247. | :ref:`int<class_int>` | :ref:`outline_size<class_RichTextLabel_theme_constant_outline_size>` | ``0`` |
  248. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  249. | :ref:`int<class_int>` | :ref:`shadow_offset_x<class_RichTextLabel_theme_constant_shadow_offset_x>` | ``1`` |
  250. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  251. | :ref:`int<class_int>` | :ref:`shadow_offset_y<class_RichTextLabel_theme_constant_shadow_offset_y>` | ``1`` |
  252. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  253. | :ref:`int<class_int>` | :ref:`shadow_outline_size<class_RichTextLabel_theme_constant_shadow_outline_size>` | ``1`` |
  254. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  255. | :ref:`int<class_int>` | :ref:`table_h_separation<class_RichTextLabel_theme_constant_table_h_separation>` | ``3`` |
  256. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  257. | :ref:`int<class_int>` | :ref:`table_v_separation<class_RichTextLabel_theme_constant_table_v_separation>` | ``3`` |
  258. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  259. | :ref:`int<class_int>` | :ref:`text_highlight_h_padding<class_RichTextLabel_theme_constant_text_highlight_h_padding>` | ``3`` |
  260. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  261. | :ref:`int<class_int>` | :ref:`text_highlight_v_padding<class_RichTextLabel_theme_constant_text_highlight_v_padding>` | ``3`` |
  262. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  263. | :ref:`Font<class_Font>` | :ref:`bold_font<class_RichTextLabel_theme_font_bold_font>` | |
  264. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  265. | :ref:`Font<class_Font>` | :ref:`bold_italics_font<class_RichTextLabel_theme_font_bold_italics_font>` | |
  266. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  267. | :ref:`Font<class_Font>` | :ref:`italics_font<class_RichTextLabel_theme_font_italics_font>` | |
  268. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  269. | :ref:`Font<class_Font>` | :ref:`mono_font<class_RichTextLabel_theme_font_mono_font>` | |
  270. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  271. | :ref:`Font<class_Font>` | :ref:`normal_font<class_RichTextLabel_theme_font_normal_font>` | |
  272. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  273. | :ref:`int<class_int>` | :ref:`bold_font_size<class_RichTextLabel_theme_font_size_bold_font_size>` | |
  274. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  275. | :ref:`int<class_int>` | :ref:`bold_italics_font_size<class_RichTextLabel_theme_font_size_bold_italics_font_size>` | |
  276. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  277. | :ref:`int<class_int>` | :ref:`italics_font_size<class_RichTextLabel_theme_font_size_italics_font_size>` | |
  278. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  279. | :ref:`int<class_int>` | :ref:`mono_font_size<class_RichTextLabel_theme_font_size_mono_font_size>` | |
  280. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  281. | :ref:`int<class_int>` | :ref:`normal_font_size<class_RichTextLabel_theme_font_size_normal_font_size>` | |
  282. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  283. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_RichTextLabel_theme_style_focus>` | |
  284. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  285. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_RichTextLabel_theme_style_normal>` | |
  286. +---------------------------------+----------------------------------------------------------------------------------------------+-----------------------------+
  287. .. rst-class:: classref-section-separator
  288. ----
  289. .. rst-class:: classref-descriptions-group
  290. Signals
  291. -------
  292. .. _class_RichTextLabel_signal_finished:
  293. .. rst-class:: classref-signal
  294. **finished** **(** **)**
  295. Triggered when the document is fully loaded.
  296. .. rst-class:: classref-item-separator
  297. ----
  298. .. _class_RichTextLabel_signal_meta_clicked:
  299. .. rst-class:: classref-signal
  300. **meta_clicked** **(** :ref:`Variant<class_Variant>` meta **)**
  301. 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.
  302. .. rst-class:: classref-item-separator
  303. ----
  304. .. _class_RichTextLabel_signal_meta_hover_ended:
  305. .. rst-class:: classref-signal
  306. **meta_hover_ended** **(** :ref:`Variant<class_Variant>` meta **)**
  307. Triggers when the mouse exits a meta tag.
  308. .. rst-class:: classref-item-separator
  309. ----
  310. .. _class_RichTextLabel_signal_meta_hover_started:
  311. .. rst-class:: classref-signal
  312. **meta_hover_started** **(** :ref:`Variant<class_Variant>` meta **)**
  313. Triggers when the mouse enters a meta tag.
  314. .. rst-class:: classref-section-separator
  315. ----
  316. .. rst-class:: classref-descriptions-group
  317. Enumerations
  318. ------------
  319. .. _enum_RichTextLabel_ListType:
  320. .. rst-class:: classref-enumeration
  321. enum **ListType**:
  322. .. _class_RichTextLabel_constant_LIST_NUMBERS:
  323. .. rst-class:: classref-enumeration-constant
  324. :ref:`ListType<enum_RichTextLabel_ListType>` **LIST_NUMBERS** = ``0``
  325. Each list item has a number marker.
  326. .. _class_RichTextLabel_constant_LIST_LETTERS:
  327. .. rst-class:: classref-enumeration-constant
  328. :ref:`ListType<enum_RichTextLabel_ListType>` **LIST_LETTERS** = ``1``
  329. Each list item has a letter marker.
  330. .. _class_RichTextLabel_constant_LIST_ROMAN:
  331. .. rst-class:: classref-enumeration-constant
  332. :ref:`ListType<enum_RichTextLabel_ListType>` **LIST_ROMAN** = ``2``
  333. Each list item has a roman number marker.
  334. .. _class_RichTextLabel_constant_LIST_DOTS:
  335. .. rst-class:: classref-enumeration-constant
  336. :ref:`ListType<enum_RichTextLabel_ListType>` **LIST_DOTS** = ``3``
  337. Each list item has a filled circle marker.
  338. .. rst-class:: classref-item-separator
  339. ----
  340. .. _enum_RichTextLabel_MenuItems:
  341. .. rst-class:: classref-enumeration
  342. enum **MenuItems**:
  343. .. _class_RichTextLabel_constant_MENU_COPY:
  344. .. rst-class:: classref-enumeration-constant
  345. :ref:`MenuItems<enum_RichTextLabel_MenuItems>` **MENU_COPY** = ``0``
  346. Copies the selected text.
  347. .. _class_RichTextLabel_constant_MENU_SELECT_ALL:
  348. .. rst-class:: classref-enumeration-constant
  349. :ref:`MenuItems<enum_RichTextLabel_MenuItems>` **MENU_SELECT_ALL** = ``1``
  350. Selects the whole **RichTextLabel** text.
  351. .. _class_RichTextLabel_constant_MENU_MAX:
  352. .. rst-class:: classref-enumeration-constant
  353. :ref:`MenuItems<enum_RichTextLabel_MenuItems>` **MENU_MAX** = ``2``
  354. Represents the size of the :ref:`MenuItems<enum_RichTextLabel_MenuItems>` enum.
  355. .. rst-class:: classref-item-separator
  356. ----
  357. .. _enum_RichTextLabel_ImageUpdateMask:
  358. .. rst-class:: classref-enumeration
  359. flags **ImageUpdateMask**:
  360. .. _class_RichTextLabel_constant_UPDATE_TEXTURE:
  361. .. rst-class:: classref-enumeration-constant
  362. :ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_TEXTURE** = ``1``
  363. If this bit is set, :ref:`update_image<class_RichTextLabel_method_update_image>` changes image texture.
  364. .. _class_RichTextLabel_constant_UPDATE_SIZE:
  365. .. rst-class:: classref-enumeration-constant
  366. :ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_SIZE** = ``2``
  367. If this bit is set, :ref:`update_image<class_RichTextLabel_method_update_image>` changes image size.
  368. .. _class_RichTextLabel_constant_UPDATE_COLOR:
  369. .. rst-class:: classref-enumeration-constant
  370. :ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_COLOR** = ``4``
  371. If this bit is set, :ref:`update_image<class_RichTextLabel_method_update_image>` changes image color.
  372. .. _class_RichTextLabel_constant_UPDATE_ALIGNMENT:
  373. .. rst-class:: classref-enumeration-constant
  374. :ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_ALIGNMENT** = ``8``
  375. If this bit is set, :ref:`update_image<class_RichTextLabel_method_update_image>` changes image inline alignment.
  376. .. _class_RichTextLabel_constant_UPDATE_REGION:
  377. .. rst-class:: classref-enumeration-constant
  378. :ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_REGION** = ``16``
  379. If this bit is set, :ref:`update_image<class_RichTextLabel_method_update_image>` changes image texture region.
  380. .. _class_RichTextLabel_constant_UPDATE_PAD:
  381. .. rst-class:: classref-enumeration-constant
  382. :ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_PAD** = ``32``
  383. If this bit is set, :ref:`update_image<class_RichTextLabel_method_update_image>` changes image padding.
  384. .. _class_RichTextLabel_constant_UPDATE_TOOLTIP:
  385. .. rst-class:: classref-enumeration-constant
  386. :ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_TOOLTIP** = ``64``
  387. If this bit is set, :ref:`update_image<class_RichTextLabel_method_update_image>` changes image tooltip.
  388. .. _class_RichTextLabel_constant_UPDATE_WIDTH_IN_PERCENT:
  389. .. rst-class:: classref-enumeration-constant
  390. :ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>` **UPDATE_WIDTH_IN_PERCENT** = ``128``
  391. If this bit is set, :ref:`update_image<class_RichTextLabel_method_update_image>` changes image width from/to percents.
  392. .. rst-class:: classref-section-separator
  393. ----
  394. .. rst-class:: classref-descriptions-group
  395. Property Descriptions
  396. ---------------------
  397. .. _class_RichTextLabel_property_autowrap_mode:
  398. .. rst-class:: classref-property
  399. :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` **autowrap_mode** = ``3``
  400. .. rst-class:: classref-property-setget
  401. - void **set_autowrap_mode** **(** :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` value **)**
  402. - :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` **get_autowrap_mode** **(** **)**
  403. If set to something other than :ref:`TextServer.AUTOWRAP_OFF<class_TextServer_constant_AUTOWRAP_OFF>`, the text gets wrapped inside the node's bounding rectangle. To see how each mode behaves, see :ref:`AutowrapMode<enum_TextServer_AutowrapMode>`.
  404. .. rst-class:: classref-item-separator
  405. ----
  406. .. _class_RichTextLabel_property_bbcode_enabled:
  407. .. rst-class:: classref-property
  408. :ref:`bool<class_bool>` **bbcode_enabled** = ``false``
  409. .. rst-class:: classref-property-setget
  410. - void **set_use_bbcode** **(** :ref:`bool<class_bool>` value **)**
  411. - :ref:`bool<class_bool>` **is_using_bbcode** **(** **)**
  412. If ``true``, the label uses BBCode formatting.
  413. .. rst-class:: classref-item-separator
  414. ----
  415. .. _class_RichTextLabel_property_context_menu_enabled:
  416. .. rst-class:: classref-property
  417. :ref:`bool<class_bool>` **context_menu_enabled** = ``false``
  418. .. rst-class:: classref-property-setget
  419. - void **set_context_menu_enabled** **(** :ref:`bool<class_bool>` value **)**
  420. - :ref:`bool<class_bool>` **is_context_menu_enabled** **(** **)**
  421. If ``true``, a right-click displays the context menu.
  422. .. rst-class:: classref-item-separator
  423. ----
  424. .. _class_RichTextLabel_property_custom_effects:
  425. .. rst-class:: classref-property
  426. :ref:`Array<class_Array>` **custom_effects** = ``[]``
  427. .. rst-class:: classref-property-setget
  428. - void **set_effects** **(** :ref:`Array<class_Array>` value **)**
  429. - :ref:`Array<class_Array>` **get_effects** **(** **)**
  430. The currently installed custom effects. This is an array of :ref:`RichTextEffect<class_RichTextEffect>`\ s.
  431. To add a custom effect, it's more convenient to use :ref:`install_effect<class_RichTextLabel_method_install_effect>`.
  432. .. rst-class:: classref-item-separator
  433. ----
  434. .. _class_RichTextLabel_property_deselect_on_focus_loss_enabled:
  435. .. rst-class:: classref-property
  436. :ref:`bool<class_bool>` **deselect_on_focus_loss_enabled** = ``true``
  437. .. rst-class:: classref-property-setget
  438. - void **set_deselect_on_focus_loss_enabled** **(** :ref:`bool<class_bool>` value **)**
  439. - :ref:`bool<class_bool>` **is_deselect_on_focus_loss_enabled** **(** **)**
  440. If ``true``, the selected text will be deselected when focus is lost.
  441. .. rst-class:: classref-item-separator
  442. ----
  443. .. _class_RichTextLabel_property_drag_and_drop_selection_enabled:
  444. .. rst-class:: classref-property
  445. :ref:`bool<class_bool>` **drag_and_drop_selection_enabled** = ``true``
  446. .. rst-class:: classref-property-setget
  447. - void **set_drag_and_drop_selection_enabled** **(** :ref:`bool<class_bool>` value **)**
  448. - :ref:`bool<class_bool>` **is_drag_and_drop_selection_enabled** **(** **)**
  449. If ``true``, allow drag and drop of selected text.
  450. .. rst-class:: classref-item-separator
  451. ----
  452. .. _class_RichTextLabel_property_fit_content:
  453. .. rst-class:: classref-property
  454. :ref:`bool<class_bool>` **fit_content** = ``false``
  455. .. rst-class:: classref-property-setget
  456. - void **set_fit_content** **(** :ref:`bool<class_bool>` value **)**
  457. - :ref:`bool<class_bool>` **is_fit_content_enabled** **(** **)**
  458. If ``true``, the label's minimum size will be automatically updated to fit its content, matching the behavior of :ref:`Label<class_Label>`.
  459. .. rst-class:: classref-item-separator
  460. ----
  461. .. _class_RichTextLabel_property_hint_underlined:
  462. .. rst-class:: classref-property
  463. :ref:`bool<class_bool>` **hint_underlined** = ``true``
  464. .. rst-class:: classref-property-setget
  465. - void **set_hint_underline** **(** :ref:`bool<class_bool>` value **)**
  466. - :ref:`bool<class_bool>` **is_hint_underlined** **(** **)**
  467. If ``true``, the label underlines hint tags such as ``[hint=description]{text}[/hint]``.
  468. .. rst-class:: classref-item-separator
  469. ----
  470. .. _class_RichTextLabel_property_language:
  471. .. rst-class:: classref-property
  472. :ref:`String<class_String>` **language** = ``""``
  473. .. rst-class:: classref-property-setget
  474. - void **set_language** **(** :ref:`String<class_String>` value **)**
  475. - :ref:`String<class_String>` **get_language** **(** **)**
  476. Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
  477. .. rst-class:: classref-item-separator
  478. ----
  479. .. _class_RichTextLabel_property_meta_underlined:
  480. .. rst-class:: classref-property
  481. :ref:`bool<class_bool>` **meta_underlined** = ``true``
  482. .. rst-class:: classref-property-setget
  483. - void **set_meta_underline** **(** :ref:`bool<class_bool>` value **)**
  484. - :ref:`bool<class_bool>` **is_meta_underlined** **(** **)**
  485. If ``true``, the label underlines meta tags such as ``[url]{text}[/url]``.
  486. .. rst-class:: classref-item-separator
  487. ----
  488. .. _class_RichTextLabel_property_progress_bar_delay:
  489. .. rst-class:: classref-property
  490. :ref:`int<class_int>` **progress_bar_delay** = ``1000``
  491. .. rst-class:: classref-property-setget
  492. - void **set_progress_bar_delay** **(** :ref:`int<class_int>` value **)**
  493. - :ref:`int<class_int>` **get_progress_bar_delay** **(** **)**
  494. The delay after which the loading progress bar is displayed, in milliseconds. Set to ``-1`` to disable progress bar entirely.
  495. \ **Note:** Progress bar is displayed only if :ref:`threaded<class_RichTextLabel_property_threaded>` is enabled.
  496. .. rst-class:: classref-item-separator
  497. ----
  498. .. _class_RichTextLabel_property_scroll_active:
  499. .. rst-class:: classref-property
  500. :ref:`bool<class_bool>` **scroll_active** = ``true``
  501. .. rst-class:: classref-property-setget
  502. - void **set_scroll_active** **(** :ref:`bool<class_bool>` value **)**
  503. - :ref:`bool<class_bool>` **is_scroll_active** **(** **)**
  504. 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>`.
  505. .. rst-class:: classref-item-separator
  506. ----
  507. .. _class_RichTextLabel_property_scroll_following:
  508. .. rst-class:: classref-property
  509. :ref:`bool<class_bool>` **scroll_following** = ``false``
  510. .. rst-class:: classref-property-setget
  511. - void **set_scroll_follow** **(** :ref:`bool<class_bool>` value **)**
  512. - :ref:`bool<class_bool>` **is_scroll_following** **(** **)**
  513. If ``true``, the window scrolls down to display new content automatically.
  514. .. rst-class:: classref-item-separator
  515. ----
  516. .. _class_RichTextLabel_property_selection_enabled:
  517. .. rst-class:: classref-property
  518. :ref:`bool<class_bool>` **selection_enabled** = ``false``
  519. .. rst-class:: classref-property-setget
  520. - void **set_selection_enabled** **(** :ref:`bool<class_bool>` value **)**
  521. - :ref:`bool<class_bool>` **is_selection_enabled** **(** **)**
  522. If ``true``, the label allows text selection.
  523. .. rst-class:: classref-item-separator
  524. ----
  525. .. _class_RichTextLabel_property_shortcut_keys_enabled:
  526. .. rst-class:: classref-property
  527. :ref:`bool<class_bool>` **shortcut_keys_enabled** = ``true``
  528. .. rst-class:: classref-property-setget
  529. - void **set_shortcut_keys_enabled** **(** :ref:`bool<class_bool>` value **)**
  530. - :ref:`bool<class_bool>` **is_shortcut_keys_enabled** **(** **)**
  531. If ``true``, shortcut keys for context menu items are enabled, even if the context menu is disabled.
  532. .. rst-class:: classref-item-separator
  533. ----
  534. .. _class_RichTextLabel_property_structured_text_bidi_override:
  535. .. rst-class:: classref-property
  536. :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **structured_text_bidi_override** = ``0``
  537. .. rst-class:: classref-property-setget
  538. - void **set_structured_text_bidi_override** **(** :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` value **)**
  539. - :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **get_structured_text_bidi_override** **(** **)**
  540. Set BiDi algorithm override for the structured text.
  541. .. rst-class:: classref-item-separator
  542. ----
  543. .. _class_RichTextLabel_property_structured_text_bidi_override_options:
  544. .. rst-class:: classref-property
  545. :ref:`Array<class_Array>` **structured_text_bidi_override_options** = ``[]``
  546. .. rst-class:: classref-property-setget
  547. - void **set_structured_text_bidi_override_options** **(** :ref:`Array<class_Array>` value **)**
  548. - :ref:`Array<class_Array>` **get_structured_text_bidi_override_options** **(** **)**
  549. Set additional options for BiDi override.
  550. .. rst-class:: classref-item-separator
  551. ----
  552. .. _class_RichTextLabel_property_tab_size:
  553. .. rst-class:: classref-property
  554. :ref:`int<class_int>` **tab_size** = ``4``
  555. .. rst-class:: classref-property-setget
  556. - void **set_tab_size** **(** :ref:`int<class_int>` value **)**
  557. - :ref:`int<class_int>` **get_tab_size** **(** **)**
  558. The number of spaces associated with a single tab length. Does not affect ``\t`` in text tags, only indent tags.
  559. .. rst-class:: classref-item-separator
  560. ----
  561. .. _class_RichTextLabel_property_text:
  562. .. rst-class:: classref-property
  563. :ref:`String<class_String>` **text** = ``""``
  564. .. rst-class:: classref-property-setget
  565. - void **set_text** **(** :ref:`String<class_String>` value **)**
  566. - :ref:`String<class_String>` **get_text** **(** **)**
  567. 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.
  568. \ **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.
  569. .. rst-class:: classref-item-separator
  570. ----
  571. .. _class_RichTextLabel_property_text_direction:
  572. .. rst-class:: classref-property
  573. :ref:`TextDirection<enum_Control_TextDirection>` **text_direction** = ``0``
  574. .. rst-class:: classref-property-setget
  575. - void **set_text_direction** **(** :ref:`TextDirection<enum_Control_TextDirection>` value **)**
  576. - :ref:`TextDirection<enum_Control_TextDirection>` **get_text_direction** **(** **)**
  577. Base text writing direction.
  578. .. rst-class:: classref-item-separator
  579. ----
  580. .. _class_RichTextLabel_property_threaded:
  581. .. rst-class:: classref-property
  582. :ref:`bool<class_bool>` **threaded** = ``false``
  583. .. rst-class:: classref-property-setget
  584. - void **set_threaded** **(** :ref:`bool<class_bool>` value **)**
  585. - :ref:`bool<class_bool>` **is_threaded** **(** **)**
  586. If ``true``, text processing is done in a background thread.
  587. .. rst-class:: classref-item-separator
  588. ----
  589. .. _class_RichTextLabel_property_visible_characters:
  590. .. rst-class:: classref-property
  591. :ref:`int<class_int>` **visible_characters** = ``-1``
  592. .. rst-class:: classref-property-setget
  593. - void **set_visible_characters** **(** :ref:`int<class_int>` value **)**
  594. - :ref:`int<class_int>` **get_visible_characters** **(** **)**
  595. The number of characters to display. If set to ``-1``, all characters are displayed. This can be useful when animating the text appearing in a dialog box.
  596. \ **Note:** Setting this property updates :ref:`visible_ratio<class_RichTextLabel_property_visible_ratio>` accordingly.
  597. .. rst-class:: classref-item-separator
  598. ----
  599. .. _class_RichTextLabel_property_visible_characters_behavior:
  600. .. rst-class:: classref-property
  601. :ref:`VisibleCharactersBehavior<enum_TextServer_VisibleCharactersBehavior>` **visible_characters_behavior** = ``0``
  602. .. rst-class:: classref-property-setget
  603. - void **set_visible_characters_behavior** **(** :ref:`VisibleCharactersBehavior<enum_TextServer_VisibleCharactersBehavior>` value **)**
  604. - :ref:`VisibleCharactersBehavior<enum_TextServer_VisibleCharactersBehavior>` **get_visible_characters_behavior** **(** **)**
  605. Sets the clipping behavior when :ref:`visible_characters<class_RichTextLabel_property_visible_characters>` or :ref:`visible_ratio<class_RichTextLabel_property_visible_ratio>` is set. See :ref:`VisibleCharactersBehavior<enum_TextServer_VisibleCharactersBehavior>` for more info.
  606. .. rst-class:: classref-item-separator
  607. ----
  608. .. _class_RichTextLabel_property_visible_ratio:
  609. .. rst-class:: classref-property
  610. :ref:`float<class_float>` **visible_ratio** = ``1.0``
  611. .. rst-class:: classref-property-setget
  612. - void **set_visible_ratio** **(** :ref:`float<class_float>` value **)**
  613. - :ref:`float<class_float>` **get_visible_ratio** **(** **)**
  614. The fraction of characters to display, relative to the total number of characters (see :ref:`get_total_character_count<class_RichTextLabel_method_get_total_character_count>`). If set to ``1.0``, all characters are displayed. If set to ``0.5``, only half of the characters will be displayed. This can be useful when animating the text appearing in a dialog box.
  615. \ **Note:** Setting this property updates :ref:`visible_characters<class_RichTextLabel_property_visible_characters>` accordingly.
  616. .. rst-class:: classref-section-separator
  617. ----
  618. .. rst-class:: classref-descriptions-group
  619. Method Descriptions
  620. -------------------
  621. .. _class_RichTextLabel_method_add_image:
  622. .. rst-class:: classref-method
  623. 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, :ref:`Rect2<class_Rect2>` region=Rect2(0, 0, 0, 0), :ref:`Variant<class_Variant>` key=null, :ref:`bool<class_bool>` pad=false, :ref:`String<class_String>` tooltip="", :ref:`bool<class_bool>` size_in_percent=false **)**
  624. Adds an image's opening and closing tags to the tag stack, optionally providing a ``width`` and ``height`` to resize the image, a ``color`` to tint the image and a ``region`` to only use parts of the image.
  625. If ``width`` or ``height`` is set to 0, the image size will be adjusted in order to keep the original aspect ratio.
  626. If ``width`` and ``height`` are not set, but ``region`` is, the region's rect will be used.
  627. \ ``key`` is an optional identifier, that can be used to modify the image via :ref:`update_image<class_RichTextLabel_method_update_image>`.
  628. If ``pad`` is set, and the image is smaller than the size specified by ``width`` and ``height``, the image padding is added to match the size instead of upscaling.
  629. If ``size_in_percent`` is set, ``width`` and ``height`` values are percentages of the control width instead of pixels.
  630. .. rst-class:: classref-item-separator
  631. ----
  632. .. _class_RichTextLabel_method_add_text:
  633. .. rst-class:: classref-method
  634. void **add_text** **(** :ref:`String<class_String>` text **)**
  635. Adds raw non-BBCode-parsed text to the tag stack.
  636. .. rst-class:: classref-item-separator
  637. ----
  638. .. _class_RichTextLabel_method_append_text:
  639. .. rst-class:: classref-method
  640. void **append_text** **(** :ref:`String<class_String>` bbcode **)**
  641. Parses ``bbcode`` and adds tags to the tag stack as needed.
  642. \ **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>`.
  643. .. rst-class:: classref-item-separator
  644. ----
  645. .. _class_RichTextLabel_method_clear:
  646. .. rst-class:: classref-method
  647. void **clear** **(** **)**
  648. Clears the tag stack.
  649. \ **Note:** This method will not modify :ref:`text<class_RichTextLabel_property_text>`, but setting :ref:`text<class_RichTextLabel_property_text>` to an empty string also clears the stack.
  650. .. rst-class:: classref-item-separator
  651. ----
  652. .. _class_RichTextLabel_method_deselect:
  653. .. rst-class:: classref-method
  654. void **deselect** **(** **)**
  655. Clears the current selection.
  656. .. rst-class:: classref-item-separator
  657. ----
  658. .. _class_RichTextLabel_method_get_character_line:
  659. .. rst-class:: classref-method
  660. :ref:`int<class_int>` **get_character_line** **(** :ref:`int<class_int>` character **)**
  661. Returns the line number of the character position provided.
  662. \ **Note:** If :ref:`threaded<class_RichTextLabel_property_threaded>` is enabled, this method returns a value for the loaded part of the document. Use :ref:`is_ready<class_RichTextLabel_method_is_ready>` or :ref:`finished<class_RichTextLabel_signal_finished>` to determine whether document is fully loaded.
  663. .. rst-class:: classref-item-separator
  664. ----
  665. .. _class_RichTextLabel_method_get_character_paragraph:
  666. .. rst-class:: classref-method
  667. :ref:`int<class_int>` **get_character_paragraph** **(** :ref:`int<class_int>` character **)**
  668. Returns the paragraph number of the character position provided.
  669. \ **Note:** If :ref:`threaded<class_RichTextLabel_property_threaded>` is enabled, this method returns a value for the loaded part of the document. Use :ref:`is_ready<class_RichTextLabel_method_is_ready>` or :ref:`finished<class_RichTextLabel_signal_finished>` to determine whether document is fully loaded.
  670. .. rst-class:: classref-item-separator
  671. ----
  672. .. _class_RichTextLabel_method_get_content_height:
  673. .. rst-class:: classref-method
  674. :ref:`int<class_int>` **get_content_height** **(** **)** |const|
  675. Returns the height of the content.
  676. \ **Note:** If :ref:`threaded<class_RichTextLabel_property_threaded>` is enabled, this method returns a value for the loaded part of the document. Use :ref:`is_ready<class_RichTextLabel_method_is_ready>` or :ref:`finished<class_RichTextLabel_signal_finished>` to determine whether document is fully loaded.
  677. .. rst-class:: classref-item-separator
  678. ----
  679. .. _class_RichTextLabel_method_get_content_width:
  680. .. rst-class:: classref-method
  681. :ref:`int<class_int>` **get_content_width** **(** **)** |const|
  682. Returns the width of the content.
  683. \ **Note:** If :ref:`threaded<class_RichTextLabel_property_threaded>` is enabled, this method returns a value for the loaded part of the document. Use :ref:`is_ready<class_RichTextLabel_method_is_ready>` or :ref:`finished<class_RichTextLabel_signal_finished>` to determine whether document is fully loaded.
  684. .. rst-class:: classref-item-separator
  685. ----
  686. .. _class_RichTextLabel_method_get_line_count:
  687. .. rst-class:: classref-method
  688. :ref:`int<class_int>` **get_line_count** **(** **)** |const|
  689. Returns the total number of lines in the text. Wrapped text is counted as multiple lines.
  690. \ **Note:** If :ref:`threaded<class_RichTextLabel_property_threaded>` is enabled, this method returns a value for the loaded part of the document. Use :ref:`is_ready<class_RichTextLabel_method_is_ready>` or :ref:`finished<class_RichTextLabel_signal_finished>` to determine whether document is fully loaded.
  691. .. rst-class:: classref-item-separator
  692. ----
  693. .. _class_RichTextLabel_method_get_line_offset:
  694. .. rst-class:: classref-method
  695. :ref:`float<class_float>` **get_line_offset** **(** :ref:`int<class_int>` line **)**
  696. Returns the vertical offset of the line found at the provided index.
  697. \ **Note:** If :ref:`threaded<class_RichTextLabel_property_threaded>` is enabled, this method returns a value for the loaded part of the document. Use :ref:`is_ready<class_RichTextLabel_method_is_ready>` or :ref:`finished<class_RichTextLabel_signal_finished>` to determine whether document is fully loaded.
  698. .. rst-class:: classref-item-separator
  699. ----
  700. .. _class_RichTextLabel_method_get_menu:
  701. .. rst-class:: classref-method
  702. :ref:`PopupMenu<class_PopupMenu>` **get_menu** **(** **)** |const|
  703. Returns the :ref:`PopupMenu<class_PopupMenu>` of this **RichTextLabel**. By default, this menu is displayed when right-clicking on the **RichTextLabel**.
  704. You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see :ref:`MenuItems<enum_RichTextLabel_MenuItems>`). For example:
  705. .. tabs::
  706. .. code-tab:: gdscript
  707. func _ready():
  708. var menu = get_menu()
  709. # Remove "Select All" item.
  710. menu.remove_item(MENU_SELECT_ALL)
  711. # Add custom items.
  712. menu.add_separator()
  713. menu.add_item("Duplicate Text", MENU_MAX + 1)
  714. # Connect callback.
  715. menu.id_pressed.connect(_on_item_pressed)
  716. func _on_item_pressed(id):
  717. if id == MENU_MAX + 1:
  718. add_text("\n" + get_parsed_text())
  719. .. code-tab:: csharp
  720. public override void _Ready()
  721. {
  722. var menu = GetMenu();
  723. // Remove "Select All" item.
  724. menu.RemoveItem(RichTextLabel.MenuItems.SelectAll);
  725. // Add custom items.
  726. menu.AddSeparator();
  727. menu.AddItem("Duplicate Text", RichTextLabel.MenuItems.Max + 1);
  728. // Add event handler.
  729. menu.IdPressed += OnItemPressed;
  730. }
  731. public void OnItemPressed(int id)
  732. {
  733. if (id == TextEdit.MenuItems.Max + 1)
  734. {
  735. AddText("\n" + GetParsedText());
  736. }
  737. }
  738. \ **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:`Window.visible<class_Window_property_visible>` property.
  739. .. rst-class:: classref-item-separator
  740. ----
  741. .. _class_RichTextLabel_method_get_paragraph_count:
  742. .. rst-class:: classref-method
  743. :ref:`int<class_int>` **get_paragraph_count** **(** **)** |const|
  744. Returns the total number of paragraphs (newlines or ``p`` tags in the tag stack's text tags). Considers wrapped text as one paragraph.
  745. .. rst-class:: classref-item-separator
  746. ----
  747. .. _class_RichTextLabel_method_get_paragraph_offset:
  748. .. rst-class:: classref-method
  749. :ref:`float<class_float>` **get_paragraph_offset** **(** :ref:`int<class_int>` paragraph **)**
  750. Returns the vertical offset of the paragraph found at the provided index.
  751. \ **Note:** If :ref:`threaded<class_RichTextLabel_property_threaded>` is enabled, this method returns a value for the loaded part of the document. Use :ref:`is_ready<class_RichTextLabel_method_is_ready>` or :ref:`finished<class_RichTextLabel_signal_finished>` to determine whether document is fully loaded.
  752. .. rst-class:: classref-item-separator
  753. ----
  754. .. _class_RichTextLabel_method_get_parsed_text:
  755. .. rst-class:: classref-method
  756. :ref:`String<class_String>` **get_parsed_text** **(** **)** |const|
  757. Returns the text without BBCode mark-up.
  758. .. rst-class:: classref-item-separator
  759. ----
  760. .. _class_RichTextLabel_method_get_selected_text:
  761. .. rst-class:: classref-method
  762. :ref:`String<class_String>` **get_selected_text** **(** **)** |const|
  763. Returns the current selection text. Does not include BBCodes.
  764. .. rst-class:: classref-item-separator
  765. ----
  766. .. _class_RichTextLabel_method_get_selection_from:
  767. .. rst-class:: classref-method
  768. :ref:`int<class_int>` **get_selection_from** **(** **)** |const|
  769. Returns the current selection first character index if a selection is active, ``-1`` otherwise. Does not include BBCodes.
  770. .. rst-class:: classref-item-separator
  771. ----
  772. .. _class_RichTextLabel_method_get_selection_to:
  773. .. rst-class:: classref-method
  774. :ref:`int<class_int>` **get_selection_to** **(** **)** |const|
  775. Returns the current selection last character index if a selection is active, ``-1`` otherwise. Does not include BBCodes.
  776. .. rst-class:: classref-item-separator
  777. ----
  778. .. _class_RichTextLabel_method_get_total_character_count:
  779. .. rst-class:: classref-method
  780. :ref:`int<class_int>` **get_total_character_count** **(** **)** |const|
  781. Returns the total number of characters from text tags. Does not include BBCodes.
  782. .. rst-class:: classref-item-separator
  783. ----
  784. .. _class_RichTextLabel_method_get_v_scroll_bar:
  785. .. rst-class:: classref-method
  786. :ref:`VScrollBar<class_VScrollBar>` **get_v_scroll_bar** **(** **)**
  787. Returns the vertical scrollbar.
  788. \ **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.
  789. .. rst-class:: classref-item-separator
  790. ----
  791. .. _class_RichTextLabel_method_get_visible_line_count:
  792. .. rst-class:: classref-method
  793. :ref:`int<class_int>` **get_visible_line_count** **(** **)** |const|
  794. Returns the number of visible lines.
  795. \ **Note:** If :ref:`threaded<class_RichTextLabel_property_threaded>` is enabled, this method returns a value for the loaded part of the document. Use :ref:`is_ready<class_RichTextLabel_method_is_ready>` or :ref:`finished<class_RichTextLabel_signal_finished>` to determine whether document is fully loaded.
  796. .. rst-class:: classref-item-separator
  797. ----
  798. .. _class_RichTextLabel_method_get_visible_paragraph_count:
  799. .. rst-class:: classref-method
  800. :ref:`int<class_int>` **get_visible_paragraph_count** **(** **)** |const|
  801. Returns the number of visible paragraphs. A paragraph is considered visible if at least one of its lines is visible.
  802. \ **Note:** If :ref:`threaded<class_RichTextLabel_property_threaded>` is enabled, this method returns a value for the loaded part of the document. Use :ref:`is_ready<class_RichTextLabel_method_is_ready>` or :ref:`finished<class_RichTextLabel_signal_finished>` to determine whether document is fully loaded.
  803. .. rst-class:: classref-item-separator
  804. ----
  805. .. _class_RichTextLabel_method_install_effect:
  806. .. rst-class:: classref-method
  807. void **install_effect** **(** :ref:`Variant<class_Variant>` effect **)**
  808. Installs a custom effect. ``effect`` should be a valid :ref:`RichTextEffect<class_RichTextEffect>`.
  809. .. rst-class:: classref-item-separator
  810. ----
  811. .. _class_RichTextLabel_method_is_menu_visible:
  812. .. rst-class:: classref-method
  813. :ref:`bool<class_bool>` **is_menu_visible** **(** **)** |const|
  814. Returns whether the menu is visible. Use this instead of ``get_menu().visible`` to improve performance (so the creation of the menu is avoided).
  815. .. rst-class:: classref-item-separator
  816. ----
  817. .. _class_RichTextLabel_method_is_ready:
  818. .. rst-class:: classref-method
  819. :ref:`bool<class_bool>` **is_ready** **(** **)** |const|
  820. If :ref:`threaded<class_RichTextLabel_property_threaded>` is enabled, returns ``true`` if the background thread has finished text processing, otherwise always return ``true``.
  821. .. rst-class:: classref-item-separator
  822. ----
  823. .. _class_RichTextLabel_method_menu_option:
  824. .. rst-class:: classref-method
  825. void **menu_option** **(** :ref:`int<class_int>` option **)**
  826. Executes a given action as defined in the :ref:`MenuItems<enum_RichTextLabel_MenuItems>` enum.
  827. .. rst-class:: classref-item-separator
  828. ----
  829. .. _class_RichTextLabel_method_newline:
  830. .. rst-class:: classref-method
  831. void **newline** **(** **)**
  832. Adds a newline tag to the tag stack.
  833. .. rst-class:: classref-item-separator
  834. ----
  835. .. _class_RichTextLabel_method_parse_bbcode:
  836. .. rst-class:: classref-method
  837. void **parse_bbcode** **(** :ref:`String<class_String>` bbcode **)**
  838. The assignment version of :ref:`append_text<class_RichTextLabel_method_append_text>`. Clears the tag stack and inserts the new content.
  839. .. rst-class:: classref-item-separator
  840. ----
  841. .. _class_RichTextLabel_method_parse_expressions_for_values:
  842. .. rst-class:: classref-method
  843. :ref:`Dictionary<class_Dictionary>` **parse_expressions_for_values** **(** :ref:`PackedStringArray<class_PackedStringArray>` expressions **)**
  844. Parses BBCode parameter ``expressions`` into a dictionary.
  845. .. rst-class:: classref-item-separator
  846. ----
  847. .. _class_RichTextLabel_method_pop:
  848. .. rst-class:: classref-method
  849. void **pop** **(** **)**
  850. Terminates the current tag. Use after ``push_*`` methods to close BBCodes manually. Does not need to follow ``add_*`` methods.
  851. .. rst-class:: classref-item-separator
  852. ----
  853. .. _class_RichTextLabel_method_pop_all:
  854. .. rst-class:: classref-method
  855. void **pop_all** **(** **)**
  856. Terminates all tags opened by ``push_*`` methods.
  857. .. rst-class:: classref-item-separator
  858. ----
  859. .. _class_RichTextLabel_method_pop_context:
  860. .. rst-class:: classref-method
  861. void **pop_context** **(** **)**
  862. Terminates tags opened after the last :ref:`push_context<class_RichTextLabel_method_push_context>` call (including context marker), or all tags if there's no context marker on the stack.
  863. .. rst-class:: classref-item-separator
  864. ----
  865. .. _class_RichTextLabel_method_push_bgcolor:
  866. .. rst-class:: classref-method
  867. void **push_bgcolor** **(** :ref:`Color<class_Color>` bgcolor **)**
  868. Adds a ``[bgcolor]`` tag to the tag stack.
  869. .. rst-class:: classref-item-separator
  870. ----
  871. .. _class_RichTextLabel_method_push_bold:
  872. .. rst-class:: classref-method
  873. void **push_bold** **(** **)**
  874. 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.
  875. .. rst-class:: classref-item-separator
  876. ----
  877. .. _class_RichTextLabel_method_push_bold_italics:
  878. .. rst-class:: classref-method
  879. void **push_bold_italics** **(** **)**
  880. Adds a ``[font]`` tag with a bold italics font to the tag stack.
  881. .. rst-class:: classref-item-separator
  882. ----
  883. .. _class_RichTextLabel_method_push_cell:
  884. .. rst-class:: classref-method
  885. void **push_cell** **(** **)**
  886. 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.
  887. .. rst-class:: classref-item-separator
  888. ----
  889. .. _class_RichTextLabel_method_push_color:
  890. .. rst-class:: classref-method
  891. void **push_color** **(** :ref:`Color<class_Color>` color **)**
  892. Adds a ``[color]`` tag to the tag stack.
  893. .. rst-class:: classref-item-separator
  894. ----
  895. .. _class_RichTextLabel_method_push_context:
  896. .. rst-class:: classref-method
  897. void **push_context** **(** **)**
  898. Adds a context marker to the tag stack. See :ref:`pop_context<class_RichTextLabel_method_pop_context>`.
  899. .. rst-class:: classref-item-separator
  900. ----
  901. .. _class_RichTextLabel_method_push_customfx:
  902. .. rst-class:: classref-method
  903. void **push_customfx** **(** :ref:`RichTextEffect<class_RichTextEffect>` effect, :ref:`Dictionary<class_Dictionary>` env **)**
  904. Adds a custom effect tag to the tag stack. The effect does not need to be in :ref:`custom_effects<class_RichTextLabel_property_custom_effects>`. The environment is directly passed to the effect.
  905. .. rst-class:: classref-item-separator
  906. ----
  907. .. _class_RichTextLabel_method_push_dropcap:
  908. .. rst-class:: classref-method
  909. 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) **)**
  910. 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.
  911. .. rst-class:: classref-item-separator
  912. ----
  913. .. _class_RichTextLabel_method_push_fgcolor:
  914. .. rst-class:: classref-method
  915. void **push_fgcolor** **(** :ref:`Color<class_Color>` fgcolor **)**
  916. Adds a ``[fgcolor]`` tag to the tag stack.
  917. .. rst-class:: classref-item-separator
  918. ----
  919. .. _class_RichTextLabel_method_push_font:
  920. .. rst-class:: classref-method
  921. void **push_font** **(** :ref:`Font<class_Font>` font, :ref:`int<class_int>` font_size=0 **)**
  922. Adds a ``[font]`` tag to the tag stack. Overrides default fonts for its duration.
  923. Passing ``0`` to ``font_size`` will use the existing default font size.
  924. .. rst-class:: classref-item-separator
  925. ----
  926. .. _class_RichTextLabel_method_push_font_size:
  927. .. rst-class:: classref-method
  928. void **push_font_size** **(** :ref:`int<class_int>` font_size **)**
  929. Adds a ``[font_size]`` tag to the tag stack. Overrides default font size for its duration.
  930. .. rst-class:: classref-item-separator
  931. ----
  932. .. _class_RichTextLabel_method_push_hint:
  933. .. rst-class:: classref-method
  934. void **push_hint** **(** :ref:`String<class_String>` description **)**
  935. Adds a ``[hint]`` tag to the tag stack. Same as BBCode ``[hint=something]{text}[/hint]``.
  936. .. rst-class:: classref-item-separator
  937. ----
  938. .. _class_RichTextLabel_method_push_indent:
  939. .. rst-class:: classref-method
  940. void **push_indent** **(** :ref:`int<class_int>` level **)**
  941. 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.
  942. .. rst-class:: classref-item-separator
  943. ----
  944. .. _class_RichTextLabel_method_push_italics:
  945. .. rst-class:: classref-method
  946. void **push_italics** **(** **)**
  947. Adds a ``[font]`` tag with an italics font to the tag stack. This is the same as adding an ``[i]`` tag if not currently in a ``[b]`` tag.
  948. .. rst-class:: classref-item-separator
  949. ----
  950. .. _class_RichTextLabel_method_push_language:
  951. .. rst-class:: classref-method
  952. void **push_language** **(** :ref:`String<class_String>` language **)**
  953. Adds language code used for text shaping algorithm and Open-Type font features.
  954. .. rst-class:: classref-item-separator
  955. ----
  956. .. _class_RichTextLabel_method_push_list:
  957. .. rst-class:: classref-method
  958. void **push_list** **(** :ref:`int<class_int>` level, :ref:`ListType<enum_RichTextLabel_ListType>` type, :ref:`bool<class_bool>` capitalize, :ref:`String<class_String>` bullet="•" **)**
  959. 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.
  960. .. rst-class:: classref-item-separator
  961. ----
  962. .. _class_RichTextLabel_method_push_meta:
  963. .. rst-class:: classref-method
  964. void **push_meta** **(** :ref:`Variant<class_Variant>` data **)**
  965. 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.
  966. .. rst-class:: classref-item-separator
  967. ----
  968. .. _class_RichTextLabel_method_push_mono:
  969. .. rst-class:: classref-method
  970. void **push_mono** **(** **)**
  971. Adds a ``[font]`` tag with a monospace font to the tag stack.
  972. .. rst-class:: classref-item-separator
  973. ----
  974. .. _class_RichTextLabel_method_push_normal:
  975. .. rst-class:: classref-method
  976. void **push_normal** **(** **)**
  977. Adds a ``[font]`` tag with a normal font to the tag stack.
  978. .. rst-class:: classref-item-separator
  979. ----
  980. .. _class_RichTextLabel_method_push_outline_color:
  981. .. rst-class:: classref-method
  982. void **push_outline_color** **(** :ref:`Color<class_Color>` color **)**
  983. Adds a ``[outline_color]`` tag to the tag stack. Adds text outline for its duration.
  984. .. rst-class:: classref-item-separator
  985. ----
  986. .. _class_RichTextLabel_method_push_outline_size:
  987. .. rst-class:: classref-method
  988. void **push_outline_size** **(** :ref:`int<class_int>` outline_size **)**
  989. Adds a ``[outline_size]`` tag to the tag stack. Overrides default text outline size for its duration.
  990. .. rst-class:: classref-item-separator
  991. ----
  992. .. _class_RichTextLabel_method_push_paragraph:
  993. .. rst-class:: classref-method
  994. 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_TextServer_StructuredTextParser>` st_parser=0, |bitfield|\<:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\> justification_flags=163, :ref:`PackedFloat32Array<class_PackedFloat32Array>` tab_stops=PackedFloat32Array() **)**
  995. Adds a ``[p]`` tag to the tag stack.
  996. .. rst-class:: classref-item-separator
  997. ----
  998. .. _class_RichTextLabel_method_push_strikethrough:
  999. .. rst-class:: classref-method
  1000. void **push_strikethrough** **(** **)**
  1001. Adds a ``[s]`` tag to the tag stack.
  1002. .. rst-class:: classref-item-separator
  1003. ----
  1004. .. _class_RichTextLabel_method_push_table:
  1005. .. rst-class:: classref-method
  1006. void **push_table** **(** :ref:`int<class_int>` columns, :ref:`InlineAlignment<enum_@GlobalScope_InlineAlignment>` inline_align=0, :ref:`int<class_int>` align_to_row=-1 **)**
  1007. Adds a ``[table=columns,inline_align]`` tag to the tag stack.
  1008. .. rst-class:: classref-item-separator
  1009. ----
  1010. .. _class_RichTextLabel_method_push_underline:
  1011. .. rst-class:: classref-method
  1012. void **push_underline** **(** **)**
  1013. Adds a ``[u]`` tag to the tag stack.
  1014. .. rst-class:: classref-item-separator
  1015. ----
  1016. .. _class_RichTextLabel_method_remove_paragraph:
  1017. .. rst-class:: classref-method
  1018. :ref:`bool<class_bool>` **remove_paragraph** **(** :ref:`int<class_int>` paragraph **)**
  1019. Removes a paragraph of content from the label. Returns ``true`` if the paragraph exists.
  1020. The ``paragraph`` argument is the index of the paragraph to remove, it can take values in the interval ``[0, get_paragraph_count() - 1]``.
  1021. .. rst-class:: classref-item-separator
  1022. ----
  1023. .. _class_RichTextLabel_method_scroll_to_line:
  1024. .. rst-class:: classref-method
  1025. void **scroll_to_line** **(** :ref:`int<class_int>` line **)**
  1026. Scrolls the window's top line to match ``line``.
  1027. .. rst-class:: classref-item-separator
  1028. ----
  1029. .. _class_RichTextLabel_method_scroll_to_paragraph:
  1030. .. rst-class:: classref-method
  1031. void **scroll_to_paragraph** **(** :ref:`int<class_int>` paragraph **)**
  1032. Scrolls the window's top line to match first line of the ``paragraph``.
  1033. .. rst-class:: classref-item-separator
  1034. ----
  1035. .. _class_RichTextLabel_method_scroll_to_selection:
  1036. .. rst-class:: classref-method
  1037. void **scroll_to_selection** **(** **)**
  1038. Scrolls to the beginning of the current selection.
  1039. .. rst-class:: classref-item-separator
  1040. ----
  1041. .. _class_RichTextLabel_method_select_all:
  1042. .. rst-class:: classref-method
  1043. void **select_all** **(** **)**
  1044. Select all the text.
  1045. If :ref:`selection_enabled<class_RichTextLabel_property_selection_enabled>` is ``false``, no selection will occur.
  1046. .. rst-class:: classref-item-separator
  1047. ----
  1048. .. _class_RichTextLabel_method_set_cell_border_color:
  1049. .. rst-class:: classref-method
  1050. void **set_cell_border_color** **(** :ref:`Color<class_Color>` color **)**
  1051. Sets color of a table cell border.
  1052. .. rst-class:: classref-item-separator
  1053. ----
  1054. .. _class_RichTextLabel_method_set_cell_padding:
  1055. .. rst-class:: classref-method
  1056. void **set_cell_padding** **(** :ref:`Rect2<class_Rect2>` padding **)**
  1057. Sets inner padding of a table cell.
  1058. .. rst-class:: classref-item-separator
  1059. ----
  1060. .. _class_RichTextLabel_method_set_cell_row_background_color:
  1061. .. rst-class:: classref-method
  1062. void **set_cell_row_background_color** **(** :ref:`Color<class_Color>` odd_row_bg, :ref:`Color<class_Color>` even_row_bg **)**
  1063. Sets color of a table cell. Separate colors for alternating rows can be specified.
  1064. .. rst-class:: classref-item-separator
  1065. ----
  1066. .. _class_RichTextLabel_method_set_cell_size_override:
  1067. .. rst-class:: classref-method
  1068. void **set_cell_size_override** **(** :ref:`Vector2<class_Vector2>` min_size, :ref:`Vector2<class_Vector2>` max_size **)**
  1069. Sets minimum and maximum size overrides for a table cell.
  1070. .. rst-class:: classref-item-separator
  1071. ----
  1072. .. _class_RichTextLabel_method_set_table_column_expand:
  1073. .. rst-class:: classref-method
  1074. void **set_table_column_expand** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` expand, :ref:`int<class_int>` ratio=1 **)**
  1075. 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.
  1076. For example, 2 columns with ratios 3 and 4 plus 70 pixels in available width would expand 30 and 40 pixels, respectively.
  1077. If ``expand`` is ``false``, the column will not contribute to the total ratio.
  1078. .. rst-class:: classref-item-separator
  1079. ----
  1080. .. _class_RichTextLabel_method_update_image:
  1081. .. rst-class:: classref-method
  1082. void **update_image** **(** :ref:`Variant<class_Variant>` key, |bitfield|\<:ref:`ImageUpdateMask<enum_RichTextLabel_ImageUpdateMask>`\> mask, :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, :ref:`Rect2<class_Rect2>` region=Rect2(0, 0, 0, 0), :ref:`bool<class_bool>` pad=false, :ref:`String<class_String>` tooltip="", :ref:`bool<class_bool>` size_in_percent=false **)**
  1083. Updates the existing images with the key ``key``. Only properties specified by ``mask`` bits are updated. See :ref:`add_image<class_RichTextLabel_method_add_image>`.
  1084. .. rst-class:: classref-section-separator
  1085. ----
  1086. .. rst-class:: classref-descriptions-group
  1087. Theme Property Descriptions
  1088. ---------------------------
  1089. .. _class_RichTextLabel_theme_color_default_color:
  1090. .. rst-class:: classref-themeproperty
  1091. :ref:`Color<class_Color>` **default_color** = ``Color(1, 1, 1, 1)``
  1092. The default text color.
  1093. .. rst-class:: classref-item-separator
  1094. ----
  1095. .. _class_RichTextLabel_theme_color_font_outline_color:
  1096. .. rst-class:: classref-themeproperty
  1097. :ref:`Color<class_Color>` **font_outline_color** = ``Color(1, 1, 1, 1)``
  1098. The default tint of text outline.
  1099. .. rst-class:: classref-item-separator
  1100. ----
  1101. .. _class_RichTextLabel_theme_color_font_selected_color:
  1102. .. rst-class:: classref-themeproperty
  1103. :ref:`Color<class_Color>` **font_selected_color** = ``Color(0, 0, 0, 0)``
  1104. The color of selected text, used when :ref:`selection_enabled<class_RichTextLabel_property_selection_enabled>` is ``true``. If equal to ``Color(0, 0, 0, 0)``, it will be ignored.
  1105. .. rst-class:: classref-item-separator
  1106. ----
  1107. .. _class_RichTextLabel_theme_color_font_shadow_color:
  1108. .. rst-class:: classref-themeproperty
  1109. :ref:`Color<class_Color>` **font_shadow_color** = ``Color(0, 0, 0, 0)``
  1110. The color of the font's shadow.
  1111. .. rst-class:: classref-item-separator
  1112. ----
  1113. .. _class_RichTextLabel_theme_color_selection_color:
  1114. .. rst-class:: classref-themeproperty
  1115. :ref:`Color<class_Color>` **selection_color** = ``Color(0.1, 0.1, 1, 0.8)``
  1116. The color of the selection box.
  1117. .. rst-class:: classref-item-separator
  1118. ----
  1119. .. _class_RichTextLabel_theme_color_table_border:
  1120. .. rst-class:: classref-themeproperty
  1121. :ref:`Color<class_Color>` **table_border** = ``Color(0, 0, 0, 0)``
  1122. The default cell border color.
  1123. .. rst-class:: classref-item-separator
  1124. ----
  1125. .. _class_RichTextLabel_theme_color_table_even_row_bg:
  1126. .. rst-class:: classref-themeproperty
  1127. :ref:`Color<class_Color>` **table_even_row_bg** = ``Color(0, 0, 0, 0)``
  1128. The default background color for even rows.
  1129. .. rst-class:: classref-item-separator
  1130. ----
  1131. .. _class_RichTextLabel_theme_color_table_odd_row_bg:
  1132. .. rst-class:: classref-themeproperty
  1133. :ref:`Color<class_Color>` **table_odd_row_bg** = ``Color(0, 0, 0, 0)``
  1134. The default background color for odd rows.
  1135. .. rst-class:: classref-item-separator
  1136. ----
  1137. .. _class_RichTextLabel_theme_constant_line_separation:
  1138. .. rst-class:: classref-themeproperty
  1139. :ref:`int<class_int>` **line_separation** = ``0``
  1140. The vertical space between lines.
  1141. .. rst-class:: classref-item-separator
  1142. ----
  1143. .. _class_RichTextLabel_theme_constant_outline_size:
  1144. .. rst-class:: classref-themeproperty
  1145. :ref:`int<class_int>` **outline_size** = ``0``
  1146. The size of the text outline.
  1147. \ **Note:** If using a font with :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` enabled, its :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` must be set to at least *twice* the value of :ref:`outline_size<class_RichTextLabel_theme_constant_outline_size>` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
  1148. .. rst-class:: classref-item-separator
  1149. ----
  1150. .. _class_RichTextLabel_theme_constant_shadow_offset_x:
  1151. .. rst-class:: classref-themeproperty
  1152. :ref:`int<class_int>` **shadow_offset_x** = ``1``
  1153. The horizontal offset of the font's shadow.
  1154. .. rst-class:: classref-item-separator
  1155. ----
  1156. .. _class_RichTextLabel_theme_constant_shadow_offset_y:
  1157. .. rst-class:: classref-themeproperty
  1158. :ref:`int<class_int>` **shadow_offset_y** = ``1``
  1159. The vertical offset of the font's shadow.
  1160. .. rst-class:: classref-item-separator
  1161. ----
  1162. .. _class_RichTextLabel_theme_constant_shadow_outline_size:
  1163. .. rst-class:: classref-themeproperty
  1164. :ref:`int<class_int>` **shadow_outline_size** = ``1``
  1165. The size of the shadow outline.
  1166. .. rst-class:: classref-item-separator
  1167. ----
  1168. .. _class_RichTextLabel_theme_constant_table_h_separation:
  1169. .. rst-class:: classref-themeproperty
  1170. :ref:`int<class_int>` **table_h_separation** = ``3``
  1171. The horizontal separation of elements in a table.
  1172. .. rst-class:: classref-item-separator
  1173. ----
  1174. .. _class_RichTextLabel_theme_constant_table_v_separation:
  1175. .. rst-class:: classref-themeproperty
  1176. :ref:`int<class_int>` **table_v_separation** = ``3``
  1177. The vertical separation of elements in a table.
  1178. .. rst-class:: classref-item-separator
  1179. ----
  1180. .. _class_RichTextLabel_theme_constant_text_highlight_h_padding:
  1181. .. rst-class:: classref-themeproperty
  1182. :ref:`int<class_int>` **text_highlight_h_padding** = ``3``
  1183. The horizontal padding around a highlighting and background color box.
  1184. .. rst-class:: classref-item-separator
  1185. ----
  1186. .. _class_RichTextLabel_theme_constant_text_highlight_v_padding:
  1187. .. rst-class:: classref-themeproperty
  1188. :ref:`int<class_int>` **text_highlight_v_padding** = ``3``
  1189. The vertical padding around a highlighting and background color box.
  1190. .. rst-class:: classref-item-separator
  1191. ----
  1192. .. _class_RichTextLabel_theme_font_bold_font:
  1193. .. rst-class:: classref-themeproperty
  1194. :ref:`Font<class_Font>` **bold_font**
  1195. The font used for bold text.
  1196. .. rst-class:: classref-item-separator
  1197. ----
  1198. .. _class_RichTextLabel_theme_font_bold_italics_font:
  1199. .. rst-class:: classref-themeproperty
  1200. :ref:`Font<class_Font>` **bold_italics_font**
  1201. The font used for bold italics text.
  1202. .. rst-class:: classref-item-separator
  1203. ----
  1204. .. _class_RichTextLabel_theme_font_italics_font:
  1205. .. rst-class:: classref-themeproperty
  1206. :ref:`Font<class_Font>` **italics_font**
  1207. The font used for italics text.
  1208. .. rst-class:: classref-item-separator
  1209. ----
  1210. .. _class_RichTextLabel_theme_font_mono_font:
  1211. .. rst-class:: classref-themeproperty
  1212. :ref:`Font<class_Font>` **mono_font**
  1213. The font used for monospace text.
  1214. .. rst-class:: classref-item-separator
  1215. ----
  1216. .. _class_RichTextLabel_theme_font_normal_font:
  1217. .. rst-class:: classref-themeproperty
  1218. :ref:`Font<class_Font>` **normal_font**
  1219. The default text font.
  1220. .. rst-class:: classref-item-separator
  1221. ----
  1222. .. _class_RichTextLabel_theme_font_size_bold_font_size:
  1223. .. rst-class:: classref-themeproperty
  1224. :ref:`int<class_int>` **bold_font_size**
  1225. The font size used for bold text.
  1226. .. rst-class:: classref-item-separator
  1227. ----
  1228. .. _class_RichTextLabel_theme_font_size_bold_italics_font_size:
  1229. .. rst-class:: classref-themeproperty
  1230. :ref:`int<class_int>` **bold_italics_font_size**
  1231. The font size used for bold italics text.
  1232. .. rst-class:: classref-item-separator
  1233. ----
  1234. .. _class_RichTextLabel_theme_font_size_italics_font_size:
  1235. .. rst-class:: classref-themeproperty
  1236. :ref:`int<class_int>` **italics_font_size**
  1237. The font size used for italics text.
  1238. .. rst-class:: classref-item-separator
  1239. ----
  1240. .. _class_RichTextLabel_theme_font_size_mono_font_size:
  1241. .. rst-class:: classref-themeproperty
  1242. :ref:`int<class_int>` **mono_font_size**
  1243. The font size used for monospace text.
  1244. .. rst-class:: classref-item-separator
  1245. ----
  1246. .. _class_RichTextLabel_theme_font_size_normal_font_size:
  1247. .. rst-class:: classref-themeproperty
  1248. :ref:`int<class_int>` **normal_font_size**
  1249. The default text font size.
  1250. .. rst-class:: classref-item-separator
  1251. ----
  1252. .. _class_RichTextLabel_theme_style_focus:
  1253. .. rst-class:: classref-themeproperty
  1254. :ref:`StyleBox<class_StyleBox>` **focus**
  1255. 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.
  1256. .. rst-class:: classref-item-separator
  1257. ----
  1258. .. _class_RichTextLabel_theme_style_normal:
  1259. .. rst-class:: classref-themeproperty
  1260. :ref:`StyleBox<class_StyleBox>` **normal**
  1261. The normal background for the **RichTextLabel**.
  1262. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  1263. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  1264. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  1265. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  1266. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  1267. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  1268. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`