class_textmesh.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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/TextMesh.xml.
  6. .. _class_TextMesh:
  7. TextMesh
  8. ========
  9. **Inherits:** :ref:`PrimitiveMesh<class_PrimitiveMesh>` **<** :ref:`Mesh<class_Mesh>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Generate an :ref:`PrimitiveMesh<class_PrimitiveMesh>` from the text.
  11. Description
  12. -----------
  13. Generate an :ref:`PrimitiveMesh<class_PrimitiveMesh>` from the text.
  14. TextMesh can be generated only when using dynamic fonts with vector glyph contours. Bitmap fonts (including bitmap data in the TrueType/OpenType containers, like color emoji fonts) are not supported.
  15. The UV layout is arranged in 4 horizontal strips, top to bottom: 40% of the height for the front face, 40% for the back face, 10% for the outer edges and 10% for the inner edges.
  16. Properties
  17. ----------
  18. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-----------+
  19. | :ref:`float<class_float>` | :ref:`curve_step<class_TextMesh_property_curve_step>` | ``0.5`` |
  20. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-----------+
  21. | :ref:`float<class_float>` | :ref:`depth<class_TextMesh_property_depth>` | ``0.05`` |
  22. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-----------+
  23. | :ref:`Font<class_Font>` | :ref:`font<class_TextMesh_property_font>` | |
  24. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-----------+
  25. | :ref:`int<class_int>` | :ref:`font_size<class_TextMesh_property_font_size>` | ``16`` |
  26. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-----------+
  27. | :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`horizontal_alignment<class_TextMesh_property_horizontal_alignment>` | ``1`` |
  28. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-----------+
  29. | :ref:`String<class_String>` | :ref:`language<class_TextMesh_property_language>` | ``""`` |
  30. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-----------+
  31. | :ref:`float<class_float>` | :ref:`pixel_size<class_TextMesh_property_pixel_size>` | ``0.01`` |
  32. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-----------+
  33. | :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` | :ref:`structured_text_bidi_override<class_TextMesh_property_structured_text_bidi_override>` | ``0`` |
  34. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-----------+
  35. | :ref:`Array<class_Array>` | :ref:`structured_text_bidi_override_options<class_TextMesh_property_structured_text_bidi_override_options>` | ``[]`` |
  36. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-----------+
  37. | :ref:`String<class_String>` | :ref:`text<class_TextMesh_property_text>` | ``""`` |
  38. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-----------+
  39. | :ref:`Direction<enum_TextServer_Direction>` | :ref:`text_direction<class_TextMesh_property_text_direction>` | ``0`` |
  40. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-----------+
  41. | :ref:`bool<class_bool>` | :ref:`uppercase<class_TextMesh_property_uppercase>` | ``false`` |
  42. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-----------+
  43. | :ref:`float<class_float>` | :ref:`width<class_TextMesh_property_width>` | ``500.0`` |
  44. +-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+-----------+
  45. Property Descriptions
  46. ---------------------
  47. .. _class_TextMesh_property_curve_step:
  48. - :ref:`float<class_float>` **curve_step**
  49. +-----------+-----------------------+
  50. | *Default* | ``0.5`` |
  51. +-----------+-----------------------+
  52. | *Setter* | set_curve_step(value) |
  53. +-----------+-----------------------+
  54. | *Getter* | get_curve_step() |
  55. +-----------+-----------------------+
  56. Step (in pixels) used to approximate Bézier curves.
  57. ----
  58. .. _class_TextMesh_property_depth:
  59. - :ref:`float<class_float>` **depth**
  60. +-----------+------------------+
  61. | *Default* | ``0.05`` |
  62. +-----------+------------------+
  63. | *Setter* | set_depth(value) |
  64. +-----------+------------------+
  65. | *Getter* | get_depth() |
  66. +-----------+------------------+
  67. Depths of the mesh, if set to ``0.0`` only front surface, is generated, and UV layout is changed to use full texture for the front face only.
  68. ----
  69. .. _class_TextMesh_property_font:
  70. - :ref:`Font<class_Font>` **font**
  71. +----------+-----------------+
  72. | *Setter* | set_font(value) |
  73. +----------+-----------------+
  74. | *Getter* | get_font() |
  75. +----------+-----------------+
  76. Font configuration used to display text.
  77. ----
  78. .. _class_TextMesh_property_font_size:
  79. - :ref:`int<class_int>` **font_size**
  80. +-----------+----------------------+
  81. | *Default* | ``16`` |
  82. +-----------+----------------------+
  83. | *Setter* | set_font_size(value) |
  84. +-----------+----------------------+
  85. | *Getter* | get_font_size() |
  86. +-----------+----------------------+
  87. Font size of the ``TextMesh``'s text.
  88. ----
  89. .. _class_TextMesh_property_horizontal_alignment:
  90. - :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **horizontal_alignment**
  91. +-----------+---------------------------------+
  92. | *Default* | ``1`` |
  93. +-----------+---------------------------------+
  94. | *Setter* | set_horizontal_alignment(value) |
  95. +-----------+---------------------------------+
  96. | *Getter* | get_horizontal_alignment() |
  97. +-----------+---------------------------------+
  98. Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` constants.
  99. ----
  100. .. _class_TextMesh_property_language:
  101. - :ref:`String<class_String>` **language**
  102. +-----------+---------------------+
  103. | *Default* | ``""`` |
  104. +-----------+---------------------+
  105. | *Setter* | set_language(value) |
  106. +-----------+---------------------+
  107. | *Getter* | get_language() |
  108. +-----------+---------------------+
  109. Language code used for text shaping algorithms, if left empty current locale is used instead.
  110. ----
  111. .. _class_TextMesh_property_pixel_size:
  112. - :ref:`float<class_float>` **pixel_size**
  113. +-----------+-----------------------+
  114. | *Default* | ``0.01`` |
  115. +-----------+-----------------------+
  116. | *Setter* | set_pixel_size(value) |
  117. +-----------+-----------------------+
  118. | *Getter* | get_pixel_size() |
  119. +-----------+-----------------------+
  120. The size of one pixel's width on the text to scale it in 3D.
  121. ----
  122. .. _class_TextMesh_property_structured_text_bidi_override:
  123. - :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **structured_text_bidi_override**
  124. +-----------+------------------------------------------+
  125. | *Default* | ``0`` |
  126. +-----------+------------------------------------------+
  127. | *Setter* | set_structured_text_bidi_override(value) |
  128. +-----------+------------------------------------------+
  129. | *Getter* | get_structured_text_bidi_override() |
  130. +-----------+------------------------------------------+
  131. Set BiDi algorithm override for the structured text.
  132. ----
  133. .. _class_TextMesh_property_structured_text_bidi_override_options:
  134. - :ref:`Array<class_Array>` **structured_text_bidi_override_options**
  135. +-----------+--------------------------------------------------+
  136. | *Default* | ``[]`` |
  137. +-----------+--------------------------------------------------+
  138. | *Setter* | set_structured_text_bidi_override_options(value) |
  139. +-----------+--------------------------------------------------+
  140. | *Getter* | get_structured_text_bidi_override_options() |
  141. +-----------+--------------------------------------------------+
  142. Set additional options for BiDi override.
  143. ----
  144. .. _class_TextMesh_property_text:
  145. - :ref:`String<class_String>` **text**
  146. +-----------+-----------------+
  147. | *Default* | ``""`` |
  148. +-----------+-----------------+
  149. | *Setter* | set_text(value) |
  150. +-----------+-----------------+
  151. | *Getter* | get_text() |
  152. +-----------+-----------------+
  153. The text to generate mesh from.
  154. ----
  155. .. _class_TextMesh_property_text_direction:
  156. - :ref:`Direction<enum_TextServer_Direction>` **text_direction**
  157. +-----------+---------------------------+
  158. | *Default* | ``0`` |
  159. +-----------+---------------------------+
  160. | *Setter* | set_text_direction(value) |
  161. +-----------+---------------------------+
  162. | *Getter* | get_text_direction() |
  163. +-----------+---------------------------+
  164. Base text writing direction.
  165. ----
  166. .. _class_TextMesh_property_uppercase:
  167. - :ref:`bool<class_bool>` **uppercase**
  168. +-----------+----------------------+
  169. | *Default* | ``false`` |
  170. +-----------+----------------------+
  171. | *Setter* | set_uppercase(value) |
  172. +-----------+----------------------+
  173. | *Getter* | is_uppercase() |
  174. +-----------+----------------------+
  175. If ``true``, all the text displays as UPPERCASE.
  176. ----
  177. .. _class_TextMesh_property_width:
  178. - :ref:`float<class_float>` **width**
  179. +-----------+------------------+
  180. | *Default* | ``500.0`` |
  181. +-----------+------------------+
  182. | *Setter* | set_width(value) |
  183. +-----------+------------------+
  184. | *Getter* | get_width() |
  185. +-----------+------------------+
  186. Text width (in pixels), used for fill alignment.
  187. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  188. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  189. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  190. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  191. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  192. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`