class_textmesh.rst 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/TextMesh.xml.
  6. .. _class_TextMesh:
  7. TextMesh
  8. ========
  9. **Inherits:** :ref:`PrimitiveMesh<class_PrimitiveMesh>` **<** :ref:`Mesh<class_Mesh>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. Generate an :ref:`PrimitiveMesh<class_PrimitiveMesh>` from the text.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Generate an :ref:`PrimitiveMesh<class_PrimitiveMesh>` from the text.
  15. 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.
  16. 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.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-----------------------------------+---------------------------------------------------------------------------+-----------+
  23. | :ref:`float<class_float>` | :ref:`curve_step<class_TextMesh_property_curve_step>` | ``0.5`` |
  24. +-----------------------------------+---------------------------------------------------------------------------+-----------+
  25. | :ref:`float<class_float>` | :ref:`depth<class_TextMesh_property_depth>` | ``0.05`` |
  26. +-----------------------------------+---------------------------------------------------------------------------+-----------+
  27. | :ref:`Font<class_Font>` | :ref:`font<class_TextMesh_property_font>` | |
  28. +-----------------------------------+---------------------------------------------------------------------------+-----------+
  29. | :ref:`Align<enum_TextMesh_Align>` | :ref:`horizontal_alignment<class_TextMesh_property_horizontal_alignment>` | ``1`` |
  30. +-----------------------------------+---------------------------------------------------------------------------+-----------+
  31. | :ref:`float<class_float>` | :ref:`pixel_size<class_TextMesh_property_pixel_size>` | ``0.01`` |
  32. +-----------------------------------+---------------------------------------------------------------------------+-----------+
  33. | :ref:`String<class_String>` | :ref:`text<class_TextMesh_property_text>` | ``""`` |
  34. +-----------------------------------+---------------------------------------------------------------------------+-----------+
  35. | :ref:`bool<class_bool>` | :ref:`uppercase<class_TextMesh_property_uppercase>` | ``false`` |
  36. +-----------------------------------+---------------------------------------------------------------------------+-----------+
  37. .. rst-class:: classref-section-separator
  38. ----
  39. .. rst-class:: classref-descriptions-group
  40. Enumerations
  41. ------------
  42. .. _enum_TextMesh_Align:
  43. .. rst-class:: classref-enumeration
  44. enum **Align**:
  45. .. _class_TextMesh_constant_ALIGN_LEFT:
  46. .. rst-class:: classref-enumeration-constant
  47. :ref:`Align<enum_TextMesh_Align>` **ALIGN_LEFT** = ``0``
  48. Align rows to the left (default).
  49. .. _class_TextMesh_constant_ALIGN_CENTER:
  50. .. rst-class:: classref-enumeration-constant
  51. :ref:`Align<enum_TextMesh_Align>` **ALIGN_CENTER** = ``1``
  52. Align rows centered.
  53. .. _class_TextMesh_constant_ALIGN_RIGHT:
  54. .. rst-class:: classref-enumeration-constant
  55. :ref:`Align<enum_TextMesh_Align>` **ALIGN_RIGHT** = ``2``
  56. Align rows to the right.
  57. .. rst-class:: classref-section-separator
  58. ----
  59. .. rst-class:: classref-descriptions-group
  60. Property Descriptions
  61. ---------------------
  62. .. _class_TextMesh_property_curve_step:
  63. .. rst-class:: classref-property
  64. :ref:`float<class_float>` **curve_step** = ``0.5``
  65. .. rst-class:: classref-property-setget
  66. - void **set_curve_step** **(** :ref:`float<class_float>` value **)**
  67. - :ref:`float<class_float>` **get_curve_step** **(** **)**
  68. Step (in pixels) used to approximate Bézier curves.
  69. .. rst-class:: classref-item-separator
  70. ----
  71. .. _class_TextMesh_property_depth:
  72. .. rst-class:: classref-property
  73. :ref:`float<class_float>` **depth** = ``0.05``
  74. .. rst-class:: classref-property-setget
  75. - void **set_depth** **(** :ref:`float<class_float>` value **)**
  76. - :ref:`float<class_float>` **get_depth** **(** **)**
  77. 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.
  78. .. rst-class:: classref-item-separator
  79. ----
  80. .. _class_TextMesh_property_font:
  81. .. rst-class:: classref-property
  82. :ref:`Font<class_Font>` **font**
  83. .. rst-class:: classref-property-setget
  84. - void **set_font** **(** :ref:`Font<class_Font>` value **)**
  85. - :ref:`Font<class_Font>` **get_font** **(** **)**
  86. :ref:`Font<class_Font>` used for the **TextMesh**'s text.
  87. .. rst-class:: classref-item-separator
  88. ----
  89. .. _class_TextMesh_property_horizontal_alignment:
  90. .. rst-class:: classref-property
  91. :ref:`Align<enum_TextMesh_Align>` **horizontal_alignment** = ``1``
  92. .. rst-class:: classref-property-setget
  93. - void **set_horizontal_alignment** **(** :ref:`Align<enum_TextMesh_Align>` value **)**
  94. - :ref:`Align<enum_TextMesh_Align>` **get_horizontal_alignment** **(** **)**
  95. Controls the text's horizontal alignment. Supports left, center and right. Set it to one of the :ref:`Align<enum_TextMesh_Align>` constants.
  96. .. rst-class:: classref-item-separator
  97. ----
  98. .. _class_TextMesh_property_pixel_size:
  99. .. rst-class:: classref-property
  100. :ref:`float<class_float>` **pixel_size** = ``0.01``
  101. .. rst-class:: classref-property-setget
  102. - void **set_pixel_size** **(** :ref:`float<class_float>` value **)**
  103. - :ref:`float<class_float>` **get_pixel_size** **(** **)**
  104. The size of one pixel's width on the text to scale it in 3D.
  105. .. rst-class:: classref-item-separator
  106. ----
  107. .. _class_TextMesh_property_text:
  108. .. rst-class:: classref-property
  109. :ref:`String<class_String>` **text** = ``""``
  110. .. rst-class:: classref-property-setget
  111. - void **set_text** **(** :ref:`String<class_String>` value **)**
  112. - :ref:`String<class_String>` **get_text** **(** **)**
  113. The text to generate mesh from.
  114. .. rst-class:: classref-item-separator
  115. ----
  116. .. _class_TextMesh_property_uppercase:
  117. .. rst-class:: classref-property
  118. :ref:`bool<class_bool>` **uppercase** = ``false``
  119. .. rst-class:: classref-property-setget
  120. - void **set_uppercase** **(** :ref:`bool<class_bool>` value **)**
  121. - :ref:`bool<class_bool>` **is_uppercase** **(** **)**
  122. If ``true``, all the text displays as UPPERCASE.
  123. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  124. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  125. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  126. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`