class_charfxtransform.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the CharFXTransform.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_CharFXTransform:
  6. CharFXTransform
  7. ===============
  8. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. Controls how an individual character will be displayed in a :ref:`RichTextEffect<class_RichTextEffect>`.
  10. Description
  11. -----------
  12. By setting various properties on this object, you can control how individual characters will be displayed in a :ref:`RichTextEffect<class_RichTextEffect>`.
  13. Tutorials
  14. ---------
  15. - :doc:`BBCode in RichTextLabel <../tutorials/ui/bbcode_in_richtextlabel>`
  16. - `RichTextEffect test project (third-party) <https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project>`__
  17. Properties
  18. ----------
  19. +-------------------------------------+------------------------------------------------------------------+-----------------------+
  20. | :ref:`Color<class_Color>` | :ref:`color<class_CharFXTransform_property_color>` | ``Color(0, 0, 0, 1)`` |
  21. +-------------------------------------+------------------------------------------------------------------+-----------------------+
  22. | :ref:`float<class_float>` | :ref:`elapsed_time<class_CharFXTransform_property_elapsed_time>` | ``0.0`` |
  23. +-------------------------------------+------------------------------------------------------------------+-----------------------+
  24. | :ref:`Dictionary<class_Dictionary>` | :ref:`env<class_CharFXTransform_property_env>` | ``{}`` |
  25. +-------------------------------------+------------------------------------------------------------------+-----------------------+
  26. | :ref:`RID<class_RID>` | :ref:`font<class_CharFXTransform_property_font>` | |
  27. +-------------------------------------+------------------------------------------------------------------+-----------------------+
  28. | :ref:`int<class_int>` | :ref:`glyph_count<class_CharFXTransform_property_glyph_count>` | ``0`` |
  29. +-------------------------------------+------------------------------------------------------------------+-----------------------+
  30. | :ref:`int<class_int>` | :ref:`glyph_flags<class_CharFXTransform_property_glyph_flags>` | ``0`` |
  31. +-------------------------------------+------------------------------------------------------------------+-----------------------+
  32. | :ref:`int<class_int>` | :ref:`glyph_index<class_CharFXTransform_property_glyph_index>` | ``0`` |
  33. +-------------------------------------+------------------------------------------------------------------+-----------------------+
  34. | :ref:`Vector2<class_Vector2>` | :ref:`offset<class_CharFXTransform_property_offset>` | ``Vector2(0, 0)`` |
  35. +-------------------------------------+------------------------------------------------------------------+-----------------------+
  36. | :ref:`bool<class_bool>` | :ref:`outline<class_CharFXTransform_property_outline>` | ``false`` |
  37. +-------------------------------------+------------------------------------------------------------------+-----------------------+
  38. | :ref:`Vector2i<class_Vector2i>` | :ref:`range<class_CharFXTransform_property_range>` | ``Vector2i(0, 0)`` |
  39. +-------------------------------------+------------------------------------------------------------------+-----------------------+
  40. | :ref:`bool<class_bool>` | :ref:`visible<class_CharFXTransform_property_visible>` | ``true`` |
  41. +-------------------------------------+------------------------------------------------------------------+-----------------------+
  42. Property Descriptions
  43. ---------------------
  44. .. _class_CharFXTransform_property_color:
  45. - :ref:`Color<class_Color>` **color**
  46. +-----------+-----------------------+
  47. | *Default* | ``Color(0, 0, 0, 1)`` |
  48. +-----------+-----------------------+
  49. | *Setter* | set_color(value) |
  50. +-----------+-----------------------+
  51. | *Getter* | get_color() |
  52. +-----------+-----------------------+
  53. The color the character will be drawn with.
  54. ----
  55. .. _class_CharFXTransform_property_elapsed_time:
  56. - :ref:`float<class_float>` **elapsed_time**
  57. +-----------+-------------------------+
  58. | *Default* | ``0.0`` |
  59. +-----------+-------------------------+
  60. | *Setter* | set_elapsed_time(value) |
  61. +-----------+-------------------------+
  62. | *Getter* | get_elapsed_time() |
  63. +-----------+-------------------------+
  64. The time elapsed since the :ref:`RichTextLabel<class_RichTextLabel>` was added to the scene tree (in seconds). Time stops when the :ref:`RichTextLabel<class_RichTextLabel>` is paused (see :ref:`Node.process_mode<class_Node_property_process_mode>`). Resets when the text in the :ref:`RichTextLabel<class_RichTextLabel>` is changed.
  65. \ **Note:** Time still passes while the :ref:`RichTextLabel<class_RichTextLabel>` is hidden.
  66. ----
  67. .. _class_CharFXTransform_property_env:
  68. - :ref:`Dictionary<class_Dictionary>` **env**
  69. +-----------+------------------------+
  70. | *Default* | ``{}`` |
  71. +-----------+------------------------+
  72. | *Setter* | set_environment(value) |
  73. +-----------+------------------------+
  74. | *Getter* | get_environment() |
  75. +-----------+------------------------+
  76. Contains the arguments passed in the opening BBCode tag. By default, arguments are strings; if their contents match a type such as :ref:`bool<class_bool>`, :ref:`int<class_int>` or :ref:`float<class_float>`, they will be converted automatically. Color codes in the form ``#rrggbb`` or ``#rgb`` will be converted to an opaque :ref:`Color<class_Color>`. String arguments may not contain spaces, even if they're quoted. If present, quotes will also be present in the final string.
  77. For example, the opening BBCode tag ``[example foo=hello bar=true baz=42 color=#ffffff]`` will map to the following :ref:`Dictionary<class_Dictionary>`:
  78. ::
  79. {"foo": "hello", "bar": true, "baz": 42, "color": Color(1, 1, 1, 1)}
  80. ----
  81. .. _class_CharFXTransform_property_font:
  82. - :ref:`RID<class_RID>` **font**
  83. +----------+-----------------+
  84. | *Setter* | set_font(value) |
  85. +----------+-----------------+
  86. | *Getter* | get_font() |
  87. +----------+-----------------+
  88. Font resource used to render glyph.
  89. ----
  90. .. _class_CharFXTransform_property_glyph_count:
  91. - :ref:`int<class_int>` **glyph_count**
  92. +-----------+------------------------+
  93. | *Default* | ``0`` |
  94. +-----------+------------------------+
  95. | *Setter* | set_glyph_count(value) |
  96. +-----------+------------------------+
  97. | *Getter* | get_glyph_count() |
  98. +-----------+------------------------+
  99. Number of glyphs in the grapheme cluster. This value is set in the first glyph of a cluster. Setting this property won't affect drawing.
  100. ----
  101. .. _class_CharFXTransform_property_glyph_flags:
  102. - :ref:`int<class_int>` **glyph_flags**
  103. +-----------+------------------------+
  104. | *Default* | ``0`` |
  105. +-----------+------------------------+
  106. | *Setter* | set_glyph_flags(value) |
  107. +-----------+------------------------+
  108. | *Getter* | get_glyph_flags() |
  109. +-----------+------------------------+
  110. Glyph flags. See :ref:`GraphemeFlag<enum_TextServer_GraphemeFlag>` for more info. Setting this property won't affect drawing.
  111. ----
  112. .. _class_CharFXTransform_property_glyph_index:
  113. - :ref:`int<class_int>` **glyph_index**
  114. +-----------+------------------------+
  115. | *Default* | ``0`` |
  116. +-----------+------------------------+
  117. | *Setter* | set_glyph_index(value) |
  118. +-----------+------------------------+
  119. | *Getter* | get_glyph_index() |
  120. +-----------+------------------------+
  121. Font specific glyph index.
  122. ----
  123. .. _class_CharFXTransform_property_offset:
  124. - :ref:`Vector2<class_Vector2>` **offset**
  125. +-----------+-------------------+
  126. | *Default* | ``Vector2(0, 0)`` |
  127. +-----------+-------------------+
  128. | *Setter* | set_offset(value) |
  129. +-----------+-------------------+
  130. | *Getter* | get_offset() |
  131. +-----------+-------------------+
  132. The position offset the character will be drawn with (in pixels).
  133. ----
  134. .. _class_CharFXTransform_property_outline:
  135. - :ref:`bool<class_bool>` **outline**
  136. +-----------+--------------------+
  137. | *Default* | ``false`` |
  138. +-----------+--------------------+
  139. | *Setter* | set_outline(value) |
  140. +-----------+--------------------+
  141. | *Getter* | is_outline() |
  142. +-----------+--------------------+
  143. If ``true``, FX transform is called for outline drawing. Setting this property won't affect drawing.
  144. ----
  145. .. _class_CharFXTransform_property_range:
  146. - :ref:`Vector2i<class_Vector2i>` **range**
  147. +-----------+--------------------+
  148. | *Default* | ``Vector2i(0, 0)`` |
  149. +-----------+--------------------+
  150. | *Setter* | set_range(value) |
  151. +-----------+--------------------+
  152. | *Getter* | get_range() |
  153. +-----------+--------------------+
  154. Absolute character range in the string, corresponding to the glyph. Setting this property won't affect drawing.
  155. ----
  156. .. _class_CharFXTransform_property_visible:
  157. - :ref:`bool<class_bool>` **visible**
  158. +-----------+-----------------------+
  159. | *Default* | ``true`` |
  160. +-----------+-----------------------+
  161. | *Setter* | set_visibility(value) |
  162. +-----------+-----------------------+
  163. | *Getter* | is_visible() |
  164. +-----------+-----------------------+
  165. If ``true``, the character will be drawn. If ``false``, the character will be hidden. Characters around hidden characters will reflow to take the space of hidden characters. If this is not desired, set their :ref:`color<class_CharFXTransform_property_color>` to ``Color(1, 1, 1, 0)`` instead.
  166. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  167. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  168. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  169. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  170. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  171. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`