class_label3d.rst 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835
  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/Label3D.xml.
  6. .. _class_Label3D:
  7. Label3D
  8. =======
  9. **Inherits:** :ref:`GeometryInstance3D<class_GeometryInstance3D>` **<** :ref:`VisualInstance3D<class_VisualInstance3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A node for displaying plain text in 3D space.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A node for displaying plain text in 3D space. By adjusting various properties of this node, you can configure things such as the text's appearance and whether it always faces the camera.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`3D text <../tutorials/3d/3d_text>`
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  25. | :ref:`float<class_float>` | :ref:`alpha_antialiasing_edge<class_Label3D_property_alpha_antialiasing_edge>` | ``0.0`` |
  26. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  27. | :ref:`AlphaAntiAliasing<enum_BaseMaterial3D_AlphaAntiAliasing>` | :ref:`alpha_antialiasing_mode<class_Label3D_property_alpha_antialiasing_mode>` | ``0`` |
  28. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  29. | :ref:`AlphaCutMode<enum_Label3D_AlphaCutMode>` | :ref:`alpha_cut<class_Label3D_property_alpha_cut>` | ``0`` |
  30. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  31. | :ref:`float<class_float>` | :ref:`alpha_hash_scale<class_Label3D_property_alpha_hash_scale>` | ``1.0`` |
  32. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  33. | :ref:`float<class_float>` | :ref:`alpha_scissor_threshold<class_Label3D_property_alpha_scissor_threshold>` | ``0.5`` |
  34. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  35. | :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` | :ref:`autowrap_mode<class_Label3D_property_autowrap_mode>` | ``0`` |
  36. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  37. | :ref:`BillboardMode<enum_BaseMaterial3D_BillboardMode>` | :ref:`billboard<class_Label3D_property_billboard>` | ``0`` |
  38. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  39. | :ref:`ShadowCastingSetting<enum_GeometryInstance3D_ShadowCastingSetting>` | cast_shadow | ``0`` (overrides :ref:`GeometryInstance3D<class_GeometryInstance3D_property_cast_shadow>`) |
  40. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  41. | :ref:`bool<class_bool>` | :ref:`double_sided<class_Label3D_property_double_sided>` | ``true`` |
  42. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`fixed_size<class_Label3D_property_fixed_size>` | ``false`` |
  44. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  45. | :ref:`Font<class_Font>` | :ref:`font<class_Label3D_property_font>` | |
  46. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  47. | :ref:`int<class_int>` | :ref:`font_size<class_Label3D_property_font_size>` | ``32`` |
  48. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  49. | :ref:`GIMode<enum_GeometryInstance3D_GIMode>` | gi_mode | ``0`` (overrides :ref:`GeometryInstance3D<class_GeometryInstance3D_property_gi_mode>`) |
  50. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  51. | :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`horizontal_alignment<class_Label3D_property_horizontal_alignment>` | ``1`` |
  52. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  53. | |bitfield|\<:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\> | :ref:`justification_flags<class_Label3D_property_justification_flags>` | ``163`` |
  54. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  55. | :ref:`String<class_String>` | :ref:`language<class_Label3D_property_language>` | ``""`` |
  56. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  57. | :ref:`float<class_float>` | :ref:`line_spacing<class_Label3D_property_line_spacing>` | ``0.0`` |
  58. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  59. | :ref:`Color<class_Color>` | :ref:`modulate<class_Label3D_property_modulate>` | ``Color(1, 1, 1, 1)`` |
  60. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  61. | :ref:`bool<class_bool>` | :ref:`no_depth_test<class_Label3D_property_no_depth_test>` | ``false`` |
  62. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  63. | :ref:`Vector2<class_Vector2>` | :ref:`offset<class_Label3D_property_offset>` | ``Vector2(0, 0)`` |
  64. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  65. | :ref:`Color<class_Color>` | :ref:`outline_modulate<class_Label3D_property_outline_modulate>` | ``Color(0, 0, 0, 1)`` |
  66. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  67. | :ref:`int<class_int>` | :ref:`outline_render_priority<class_Label3D_property_outline_render_priority>` | ``-1`` |
  68. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  69. | :ref:`int<class_int>` | :ref:`outline_size<class_Label3D_property_outline_size>` | ``12`` |
  70. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  71. | :ref:`float<class_float>` | :ref:`pixel_size<class_Label3D_property_pixel_size>` | ``0.005`` |
  72. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  73. | :ref:`int<class_int>` | :ref:`render_priority<class_Label3D_property_render_priority>` | ``0`` |
  74. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  75. | :ref:`bool<class_bool>` | :ref:`shaded<class_Label3D_property_shaded>` | ``false`` |
  76. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  77. | :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` | :ref:`structured_text_bidi_override<class_Label3D_property_structured_text_bidi_override>` | ``0`` |
  78. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  79. | :ref:`Array<class_Array>` | :ref:`structured_text_bidi_override_options<class_Label3D_property_structured_text_bidi_override_options>` | ``[]`` |
  80. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  81. | :ref:`String<class_String>` | :ref:`text<class_Label3D_property_text>` | ``""`` |
  82. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  83. | :ref:`Direction<enum_TextServer_Direction>` | :ref:`text_direction<class_Label3D_property_text_direction>` | ``0`` |
  84. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  85. | :ref:`TextureFilter<enum_BaseMaterial3D_TextureFilter>` | :ref:`texture_filter<class_Label3D_property_texture_filter>` | ``3`` |
  86. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  87. | :ref:`bool<class_bool>` | :ref:`uppercase<class_Label3D_property_uppercase>` | ``false`` |
  88. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  89. | :ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>` | :ref:`vertical_alignment<class_Label3D_property_vertical_alignment>` | ``1`` |
  90. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  91. | :ref:`float<class_float>` | :ref:`width<class_Label3D_property_width>` | ``500.0`` |
  92. +---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------+
  93. .. rst-class:: classref-reftable-group
  94. Methods
  95. -------
  96. .. table::
  97. :widths: auto
  98. +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`TriangleMesh<class_TriangleMesh>` | :ref:`generate_triangle_mesh<class_Label3D_method_generate_triangle_mesh>` **(** **)** |const| |
  100. +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`bool<class_bool>` | :ref:`get_draw_flag<class_Label3D_method_get_draw_flag>` **(** :ref:`DrawFlags<enum_Label3D_DrawFlags>` flag **)** |const| |
  102. +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`set_draw_flag<class_Label3D_method_set_draw_flag>` **(** :ref:`DrawFlags<enum_Label3D_DrawFlags>` flag, :ref:`bool<class_bool>` enabled **)** |
  104. +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
  105. .. rst-class:: classref-section-separator
  106. ----
  107. .. rst-class:: classref-descriptions-group
  108. Enumerations
  109. ------------
  110. .. _enum_Label3D_DrawFlags:
  111. .. rst-class:: classref-enumeration
  112. enum **DrawFlags**:
  113. .. _class_Label3D_constant_FLAG_SHADED:
  114. .. rst-class:: classref-enumeration-constant
  115. :ref:`DrawFlags<enum_Label3D_DrawFlags>` **FLAG_SHADED** = ``0``
  116. If set, lights in the environment affect the label.
  117. .. _class_Label3D_constant_FLAG_DOUBLE_SIDED:
  118. .. rst-class:: classref-enumeration-constant
  119. :ref:`DrawFlags<enum_Label3D_DrawFlags>` **FLAG_DOUBLE_SIDED** = ``1``
  120. If set, text can be seen from the back as well. If not, the text is invisible when looking at it from behind.
  121. .. _class_Label3D_constant_FLAG_DISABLE_DEPTH_TEST:
  122. .. rst-class:: classref-enumeration-constant
  123. :ref:`DrawFlags<enum_Label3D_DrawFlags>` **FLAG_DISABLE_DEPTH_TEST** = ``2``
  124. Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it.
  125. .. _class_Label3D_constant_FLAG_FIXED_SIZE:
  126. .. rst-class:: classref-enumeration-constant
  127. :ref:`DrawFlags<enum_Label3D_DrawFlags>` **FLAG_FIXED_SIZE** = ``3``
  128. Label is scaled by depth so that it always appears the same size on screen.
  129. .. _class_Label3D_constant_FLAG_MAX:
  130. .. rst-class:: classref-enumeration-constant
  131. :ref:`DrawFlags<enum_Label3D_DrawFlags>` **FLAG_MAX** = ``4``
  132. Represents the size of the :ref:`DrawFlags<enum_Label3D_DrawFlags>` enum.
  133. .. rst-class:: classref-item-separator
  134. ----
  135. .. _enum_Label3D_AlphaCutMode:
  136. .. rst-class:: classref-enumeration
  137. enum **AlphaCutMode**:
  138. .. _class_Label3D_constant_ALPHA_CUT_DISABLED:
  139. .. rst-class:: classref-enumeration-constant
  140. :ref:`AlphaCutMode<enum_Label3D_AlphaCutMode>` **ALPHA_CUT_DISABLED** = ``0``
  141. This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping. :ref:`GeometryInstance3D.cast_shadow<class_GeometryInstance3D_property_cast_shadow>` has no effect when this transparency mode is used; the **Label3D** will never cast shadows.
  142. .. _class_Label3D_constant_ALPHA_CUT_DISCARD:
  143. .. rst-class:: classref-enumeration-constant
  144. :ref:`AlphaCutMode<enum_Label3D_AlphaCutMode>` **ALPHA_CUT_DISCARD** = ``1``
  145. This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible unless some form of screen-space antialiasing is enabled (see :ref:`ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa<class_ProjectSettings_property_rendering/anti_aliasing/quality/screen_space_aa>`). This mode is also known as *alpha testing* or *1-bit transparency*.
  146. \ **Note:** This mode might have issues with anti-aliased fonts and outlines, try adjusting :ref:`alpha_scissor_threshold<class_Label3D_property_alpha_scissor_threshold>` or using MSDF font.
  147. \ **Note:** When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline.
  148. .. _class_Label3D_constant_ALPHA_CUT_OPAQUE_PREPASS:
  149. .. rst-class:: classref-enumeration-constant
  150. :ref:`AlphaCutMode<enum_Label3D_AlphaCutMode>` **ALPHA_CUT_OPAQUE_PREPASS** = ``2``
  151. This mode draws fully opaque pixels in the depth prepass. This is slower than :ref:`ALPHA_CUT_DISABLED<class_Label3D_constant_ALPHA_CUT_DISABLED>` or :ref:`ALPHA_CUT_DISCARD<class_Label3D_constant_ALPHA_CUT_DISCARD>`, but it allows displaying translucent areas and smooth edges while using proper sorting.
  152. \ **Note:** When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline.
  153. .. _class_Label3D_constant_ALPHA_CUT_HASH:
  154. .. rst-class:: classref-enumeration-constant
  155. :ref:`AlphaCutMode<enum_Label3D_AlphaCutMode>` **ALPHA_CUT_HASH** = ``3``
  156. This mode draws cuts off all values below a spatially-deterministic threshold, the rest will remain opaque.
  157. .. rst-class:: classref-section-separator
  158. ----
  159. .. rst-class:: classref-descriptions-group
  160. Property Descriptions
  161. ---------------------
  162. .. _class_Label3D_property_alpha_antialiasing_edge:
  163. .. rst-class:: classref-property
  164. :ref:`float<class_float>` **alpha_antialiasing_edge** = ``0.0``
  165. .. rst-class:: classref-property-setget
  166. - void **set_alpha_antialiasing_edge** **(** :ref:`float<class_float>` value **)**
  167. - :ref:`float<class_float>` **get_alpha_antialiasing_edge** **(** **)**
  168. Threshold at which antialiasing will be applied on the alpha channel.
  169. .. rst-class:: classref-item-separator
  170. ----
  171. .. _class_Label3D_property_alpha_antialiasing_mode:
  172. .. rst-class:: classref-property
  173. :ref:`AlphaAntiAliasing<enum_BaseMaterial3D_AlphaAntiAliasing>` **alpha_antialiasing_mode** = ``0``
  174. .. rst-class:: classref-property-setget
  175. - void **set_alpha_antialiasing** **(** :ref:`AlphaAntiAliasing<enum_BaseMaterial3D_AlphaAntiAliasing>` value **)**
  176. - :ref:`AlphaAntiAliasing<enum_BaseMaterial3D_AlphaAntiAliasing>` **get_alpha_antialiasing** **(** **)**
  177. The type of alpha antialiasing to apply. See :ref:`AlphaAntiAliasing<enum_BaseMaterial3D_AlphaAntiAliasing>`.
  178. .. rst-class:: classref-item-separator
  179. ----
  180. .. _class_Label3D_property_alpha_cut:
  181. .. rst-class:: classref-property
  182. :ref:`AlphaCutMode<enum_Label3D_AlphaCutMode>` **alpha_cut** = ``0``
  183. .. rst-class:: classref-property-setget
  184. - void **set_alpha_cut_mode** **(** :ref:`AlphaCutMode<enum_Label3D_AlphaCutMode>` value **)**
  185. - :ref:`AlphaCutMode<enum_Label3D_AlphaCutMode>` **get_alpha_cut_mode** **(** **)**
  186. The alpha cutting mode to use for the sprite. See :ref:`AlphaCutMode<enum_Label3D_AlphaCutMode>` for possible values.
  187. .. rst-class:: classref-item-separator
  188. ----
  189. .. _class_Label3D_property_alpha_hash_scale:
  190. .. rst-class:: classref-property
  191. :ref:`float<class_float>` **alpha_hash_scale** = ``1.0``
  192. .. rst-class:: classref-property-setget
  193. - void **set_alpha_hash_scale** **(** :ref:`float<class_float>` value **)**
  194. - :ref:`float<class_float>` **get_alpha_hash_scale** **(** **)**
  195. The hashing scale for Alpha Hash. Recommended values between ``0`` and ``2``.
  196. .. rst-class:: classref-item-separator
  197. ----
  198. .. _class_Label3D_property_alpha_scissor_threshold:
  199. .. rst-class:: classref-property
  200. :ref:`float<class_float>` **alpha_scissor_threshold** = ``0.5``
  201. .. rst-class:: classref-property-setget
  202. - void **set_alpha_scissor_threshold** **(** :ref:`float<class_float>` value **)**
  203. - :ref:`float<class_float>` **get_alpha_scissor_threshold** **(** **)**
  204. Threshold at which the alpha scissor will discard values.
  205. .. rst-class:: classref-item-separator
  206. ----
  207. .. _class_Label3D_property_autowrap_mode:
  208. .. rst-class:: classref-property
  209. :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` **autowrap_mode** = ``0``
  210. .. rst-class:: classref-property-setget
  211. - void **set_autowrap_mode** **(** :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` value **)**
  212. - :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` **get_autowrap_mode** **(** **)**
  213. 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. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see :ref:`AutowrapMode<enum_TextServer_AutowrapMode>`.
  214. .. rst-class:: classref-item-separator
  215. ----
  216. .. _class_Label3D_property_billboard:
  217. .. rst-class:: classref-property
  218. :ref:`BillboardMode<enum_BaseMaterial3D_BillboardMode>` **billboard** = ``0``
  219. .. rst-class:: classref-property-setget
  220. - void **set_billboard_mode** **(** :ref:`BillboardMode<enum_BaseMaterial3D_BillboardMode>` value **)**
  221. - :ref:`BillboardMode<enum_BaseMaterial3D_BillboardMode>` **get_billboard_mode** **(** **)**
  222. The billboard mode to use for the label. See :ref:`BillboardMode<enum_BaseMaterial3D_BillboardMode>` for possible values.
  223. .. rst-class:: classref-item-separator
  224. ----
  225. .. _class_Label3D_property_double_sided:
  226. .. rst-class:: classref-property
  227. :ref:`bool<class_bool>` **double_sided** = ``true``
  228. .. rst-class:: classref-property-setget
  229. - void **set_draw_flag** **(** :ref:`DrawFlags<enum_Label3D_DrawFlags>` flag, :ref:`bool<class_bool>` enabled **)**
  230. - :ref:`bool<class_bool>` **get_draw_flag** **(** :ref:`DrawFlags<enum_Label3D_DrawFlags>` flag **)** |const|
  231. If ``true``, text can be seen from the back as well, if ``false``, it is invisible when looking at it from behind.
  232. .. rst-class:: classref-item-separator
  233. ----
  234. .. _class_Label3D_property_fixed_size:
  235. .. rst-class:: classref-property
  236. :ref:`bool<class_bool>` **fixed_size** = ``false``
  237. .. rst-class:: classref-property-setget
  238. - void **set_draw_flag** **(** :ref:`DrawFlags<enum_Label3D_DrawFlags>` flag, :ref:`bool<class_bool>` enabled **)**
  239. - :ref:`bool<class_bool>` **get_draw_flag** **(** :ref:`DrawFlags<enum_Label3D_DrawFlags>` flag **)** |const|
  240. If ``true``, the label is rendered at the same size regardless of distance.
  241. .. rst-class:: classref-item-separator
  242. ----
  243. .. _class_Label3D_property_font:
  244. .. rst-class:: classref-property
  245. :ref:`Font<class_Font>` **font**
  246. .. rst-class:: classref-property-setget
  247. - void **set_font** **(** :ref:`Font<class_Font>` value **)**
  248. - :ref:`Font<class_Font>` **get_font** **(** **)**
  249. Font configuration used to display text.
  250. .. rst-class:: classref-item-separator
  251. ----
  252. .. _class_Label3D_property_font_size:
  253. .. rst-class:: classref-property
  254. :ref:`int<class_int>` **font_size** = ``32``
  255. .. rst-class:: classref-property-setget
  256. - void **set_font_size** **(** :ref:`int<class_int>` value **)**
  257. - :ref:`int<class_int>` **get_font_size** **(** **)**
  258. Font size of the **Label3D**'s text. To make the font look more detailed when up close, increase :ref:`font_size<class_Label3D_property_font_size>` while decreasing :ref:`pixel_size<class_Label3D_property_pixel_size>` at the same time.
  259. Higher font sizes require more time to render new characters, which can cause stuttering during gameplay.
  260. .. rst-class:: classref-item-separator
  261. ----
  262. .. _class_Label3D_property_horizontal_alignment:
  263. .. rst-class:: classref-property
  264. :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **horizontal_alignment** = ``1``
  265. .. rst-class:: classref-property-setget
  266. - void **set_horizontal_alignment** **(** :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` value **)**
  267. - :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **get_horizontal_alignment** **(** **)**
  268. 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.
  269. .. rst-class:: classref-item-separator
  270. ----
  271. .. _class_Label3D_property_justification_flags:
  272. .. rst-class:: classref-property
  273. |bitfield|\<:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\> **justification_flags** = ``163``
  274. .. rst-class:: classref-property-setget
  275. - void **set_justification_flags** **(** |bitfield|\<:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\> value **)**
  276. - |bitfield|\<:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\> **get_justification_flags** **(** **)**
  277. Line fill alignment rules. For more info see :ref:`JustificationFlag<enum_TextServer_JustificationFlag>`.
  278. .. rst-class:: classref-item-separator
  279. ----
  280. .. _class_Label3D_property_language:
  281. .. rst-class:: classref-property
  282. :ref:`String<class_String>` **language** = ``""``
  283. .. rst-class:: classref-property-setget
  284. - void **set_language** **(** :ref:`String<class_String>` value **)**
  285. - :ref:`String<class_String>` **get_language** **(** **)**
  286. Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
  287. .. rst-class:: classref-item-separator
  288. ----
  289. .. _class_Label3D_property_line_spacing:
  290. .. rst-class:: classref-property
  291. :ref:`float<class_float>` **line_spacing** = ``0.0``
  292. .. rst-class:: classref-property-setget
  293. - void **set_line_spacing** **(** :ref:`float<class_float>` value **)**
  294. - :ref:`float<class_float>` **get_line_spacing** **(** **)**
  295. Vertical space between lines in multiline **Label3D**.
  296. .. rst-class:: classref-item-separator
  297. ----
  298. .. _class_Label3D_property_modulate:
  299. .. rst-class:: classref-property
  300. :ref:`Color<class_Color>` **modulate** = ``Color(1, 1, 1, 1)``
  301. .. rst-class:: classref-property-setget
  302. - void **set_modulate** **(** :ref:`Color<class_Color>` value **)**
  303. - :ref:`Color<class_Color>` **get_modulate** **(** **)**
  304. Text :ref:`Color<class_Color>` of the **Label3D**.
  305. .. rst-class:: classref-item-separator
  306. ----
  307. .. _class_Label3D_property_no_depth_test:
  308. .. rst-class:: classref-property
  309. :ref:`bool<class_bool>` **no_depth_test** = ``false``
  310. .. rst-class:: classref-property-setget
  311. - void **set_draw_flag** **(** :ref:`DrawFlags<enum_Label3D_DrawFlags>` flag, :ref:`bool<class_bool>` enabled **)**
  312. - :ref:`bool<class_bool>` **get_draw_flag** **(** :ref:`DrawFlags<enum_Label3D_DrawFlags>` flag **)** |const|
  313. If ``true``, depth testing is disabled and the object will be drawn in render order.
  314. .. rst-class:: classref-item-separator
  315. ----
  316. .. _class_Label3D_property_offset:
  317. .. rst-class:: classref-property
  318. :ref:`Vector2<class_Vector2>` **offset** = ``Vector2(0, 0)``
  319. .. rst-class:: classref-property-setget
  320. - void **set_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
  321. - :ref:`Vector2<class_Vector2>` **get_offset** **(** **)**
  322. The text drawing offset (in pixels).
  323. .. rst-class:: classref-item-separator
  324. ----
  325. .. _class_Label3D_property_outline_modulate:
  326. .. rst-class:: classref-property
  327. :ref:`Color<class_Color>` **outline_modulate** = ``Color(0, 0, 0, 1)``
  328. .. rst-class:: classref-property-setget
  329. - void **set_outline_modulate** **(** :ref:`Color<class_Color>` value **)**
  330. - :ref:`Color<class_Color>` **get_outline_modulate** **(** **)**
  331. The tint of text outline.
  332. .. rst-class:: classref-item-separator
  333. ----
  334. .. _class_Label3D_property_outline_render_priority:
  335. .. rst-class:: classref-property
  336. :ref:`int<class_int>` **outline_render_priority** = ``-1``
  337. .. rst-class:: classref-property-setget
  338. - void **set_outline_render_priority** **(** :ref:`int<class_int>` value **)**
  339. - :ref:`int<class_int>` **get_outline_render_priority** **(** **)**
  340. Sets the render priority for the text outline. Higher priority objects will be sorted in front of lower priority objects.
  341. \ **Note:** This only applies if :ref:`alpha_cut<class_Label3D_property_alpha_cut>` is set to :ref:`ALPHA_CUT_DISABLED<class_Label3D_constant_ALPHA_CUT_DISABLED>` (default value).
  342. \ **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).
  343. .. rst-class:: classref-item-separator
  344. ----
  345. .. _class_Label3D_property_outline_size:
  346. .. rst-class:: classref-property
  347. :ref:`int<class_int>` **outline_size** = ``12``
  348. .. rst-class:: classref-property-setget
  349. - void **set_outline_size** **(** :ref:`int<class_int>` value **)**
  350. - :ref:`int<class_int>` **get_outline_size** **(** **)**
  351. Text outline size.
  352. .. rst-class:: classref-item-separator
  353. ----
  354. .. _class_Label3D_property_pixel_size:
  355. .. rst-class:: classref-property
  356. :ref:`float<class_float>` **pixel_size** = ``0.005``
  357. .. rst-class:: classref-property-setget
  358. - void **set_pixel_size** **(** :ref:`float<class_float>` value **)**
  359. - :ref:`float<class_float>` **get_pixel_size** **(** **)**
  360. The size of one pixel's width on the label to scale it in 3D. To make the font look more detailed when up close, increase :ref:`font_size<class_Label3D_property_font_size>` while decreasing :ref:`pixel_size<class_Label3D_property_pixel_size>` at the same time.
  361. .. rst-class:: classref-item-separator
  362. ----
  363. .. _class_Label3D_property_render_priority:
  364. .. rst-class:: classref-property
  365. :ref:`int<class_int>` **render_priority** = ``0``
  366. .. rst-class:: classref-property-setget
  367. - void **set_render_priority** **(** :ref:`int<class_int>` value **)**
  368. - :ref:`int<class_int>` **get_render_priority** **(** **)**
  369. Sets the render priority for the text. Higher priority objects will be sorted in front of lower priority objects.
  370. \ **Note:** This only applies if :ref:`alpha_cut<class_Label3D_property_alpha_cut>` is set to :ref:`ALPHA_CUT_DISABLED<class_Label3D_constant_ALPHA_CUT_DISABLED>` (default value).
  371. \ **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).
  372. .. rst-class:: classref-item-separator
  373. ----
  374. .. _class_Label3D_property_shaded:
  375. .. rst-class:: classref-property
  376. :ref:`bool<class_bool>` **shaded** = ``false``
  377. .. rst-class:: classref-property-setget
  378. - void **set_draw_flag** **(** :ref:`DrawFlags<enum_Label3D_DrawFlags>` flag, :ref:`bool<class_bool>` enabled **)**
  379. - :ref:`bool<class_bool>` **get_draw_flag** **(** :ref:`DrawFlags<enum_Label3D_DrawFlags>` flag **)** |const|
  380. If ``true``, the :ref:`Light3D<class_Light3D>` in the :ref:`Environment<class_Environment>` has effects on the label.
  381. .. rst-class:: classref-item-separator
  382. ----
  383. .. _class_Label3D_property_structured_text_bidi_override:
  384. .. rst-class:: classref-property
  385. :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **structured_text_bidi_override** = ``0``
  386. .. rst-class:: classref-property-setget
  387. - void **set_structured_text_bidi_override** **(** :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` value **)**
  388. - :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **get_structured_text_bidi_override** **(** **)**
  389. Set BiDi algorithm override for the structured text.
  390. .. rst-class:: classref-item-separator
  391. ----
  392. .. _class_Label3D_property_structured_text_bidi_override_options:
  393. .. rst-class:: classref-property
  394. :ref:`Array<class_Array>` **structured_text_bidi_override_options** = ``[]``
  395. .. rst-class:: classref-property-setget
  396. - void **set_structured_text_bidi_override_options** **(** :ref:`Array<class_Array>` value **)**
  397. - :ref:`Array<class_Array>` **get_structured_text_bidi_override_options** **(** **)**
  398. Set additional options for BiDi override.
  399. .. rst-class:: classref-item-separator
  400. ----
  401. .. _class_Label3D_property_text:
  402. .. rst-class:: classref-property
  403. :ref:`String<class_String>` **text** = ``""``
  404. .. rst-class:: classref-property-setget
  405. - void **set_text** **(** :ref:`String<class_String>` value **)**
  406. - :ref:`String<class_String>` **get_text** **(** **)**
  407. The text to display on screen.
  408. .. rst-class:: classref-item-separator
  409. ----
  410. .. _class_Label3D_property_text_direction:
  411. .. rst-class:: classref-property
  412. :ref:`Direction<enum_TextServer_Direction>` **text_direction** = ``0``
  413. .. rst-class:: classref-property-setget
  414. - void **set_text_direction** **(** :ref:`Direction<enum_TextServer_Direction>` value **)**
  415. - :ref:`Direction<enum_TextServer_Direction>` **get_text_direction** **(** **)**
  416. Base text writing direction.
  417. .. rst-class:: classref-item-separator
  418. ----
  419. .. _class_Label3D_property_texture_filter:
  420. .. rst-class:: classref-property
  421. :ref:`TextureFilter<enum_BaseMaterial3D_TextureFilter>` **texture_filter** = ``3``
  422. .. rst-class:: classref-property-setget
  423. - void **set_texture_filter** **(** :ref:`TextureFilter<enum_BaseMaterial3D_TextureFilter>` value **)**
  424. - :ref:`TextureFilter<enum_BaseMaterial3D_TextureFilter>` **get_texture_filter** **(** **)**
  425. Filter flags for the texture. See :ref:`TextureFilter<enum_BaseMaterial3D_TextureFilter>` for options.
  426. .. rst-class:: classref-item-separator
  427. ----
  428. .. _class_Label3D_property_uppercase:
  429. .. rst-class:: classref-property
  430. :ref:`bool<class_bool>` **uppercase** = ``false``
  431. .. rst-class:: classref-property-setget
  432. - void **set_uppercase** **(** :ref:`bool<class_bool>` value **)**
  433. - :ref:`bool<class_bool>` **is_uppercase** **(** **)**
  434. If ``true``, all the text displays as UPPERCASE.
  435. .. rst-class:: classref-item-separator
  436. ----
  437. .. _class_Label3D_property_vertical_alignment:
  438. .. rst-class:: classref-property
  439. :ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>` **vertical_alignment** = ``1``
  440. .. rst-class:: classref-property-setget
  441. - void **set_vertical_alignment** **(** :ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>` value **)**
  442. - :ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>` **get_vertical_alignment** **(** **)**
  443. Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the :ref:`VerticalAlignment<enum_@GlobalScope_VerticalAlignment>` constants.
  444. .. rst-class:: classref-item-separator
  445. ----
  446. .. _class_Label3D_property_width:
  447. .. rst-class:: classref-property
  448. :ref:`float<class_float>` **width** = ``500.0``
  449. .. rst-class:: classref-property-setget
  450. - void **set_width** **(** :ref:`float<class_float>` value **)**
  451. - :ref:`float<class_float>` **get_width** **(** **)**
  452. Text width (in pixels), used for autowrap and fill alignment.
  453. .. rst-class:: classref-section-separator
  454. ----
  455. .. rst-class:: classref-descriptions-group
  456. Method Descriptions
  457. -------------------
  458. .. _class_Label3D_method_generate_triangle_mesh:
  459. .. rst-class:: classref-method
  460. :ref:`TriangleMesh<class_TriangleMesh>` **generate_triangle_mesh** **(** **)** |const|
  461. Returns a :ref:`TriangleMesh<class_TriangleMesh>` with the label's vertices following its current configuration (such as its :ref:`pixel_size<class_Label3D_property_pixel_size>`).
  462. .. rst-class:: classref-item-separator
  463. ----
  464. .. _class_Label3D_method_get_draw_flag:
  465. .. rst-class:: classref-method
  466. :ref:`bool<class_bool>` **get_draw_flag** **(** :ref:`DrawFlags<enum_Label3D_DrawFlags>` flag **)** |const|
  467. Returns the value of the specified flag.
  468. .. rst-class:: classref-item-separator
  469. ----
  470. .. _class_Label3D_method_set_draw_flag:
  471. .. rst-class:: classref-method
  472. void **set_draw_flag** **(** :ref:`DrawFlags<enum_Label3D_DrawFlags>` flag, :ref:`bool<class_bool>` enabled **)**
  473. If ``true``, the specified flag will be enabled. See :ref:`DrawFlags<enum_Label3D_DrawFlags>` for a list of flags.
  474. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  475. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  476. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  477. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  478. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  479. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  480. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`