class_label3d.rst 43 KB

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