class_label3d.rst 44 KB

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