class_spritebase3d.rst 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  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/SpriteBase3D.xml.
  6. .. _class_SpriteBase3D:
  7. SpriteBase3D
  8. ============
  9. **Inherits:** :ref:`GeometryInstance3D<class_GeometryInstance3D>` **<** :ref:`VisualInstance3D<class_VisualInstance3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`AnimatedSprite3D<class_AnimatedSprite3D>`, :ref:`Sprite3D<class_Sprite3D>`
  11. 2D sprite node in 3D environment.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. A node that displays 2D texture information in a 3D environment. See also :ref:`Sprite3D<class_Sprite3D>` where many other properties are defined.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  22. | :ref:`float<class_float>` | :ref:`alpha_antialiasing_edge<class_SpriteBase3D_property_alpha_antialiasing_edge>` | ``0.0`` |
  23. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  24. | :ref:`AlphaAntiAliasing<enum_BaseMaterial3D_AlphaAntiAliasing>` | :ref:`alpha_antialiasing_mode<class_SpriteBase3D_property_alpha_antialiasing_mode>` | ``0`` |
  25. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  26. | :ref:`AlphaCutMode<enum_SpriteBase3D_AlphaCutMode>` | :ref:`alpha_cut<class_SpriteBase3D_property_alpha_cut>` | ``0`` |
  27. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  28. | :ref:`float<class_float>` | :ref:`alpha_hash_scale<class_SpriteBase3D_property_alpha_hash_scale>` | ``1.0`` |
  29. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  30. | :ref:`float<class_float>` | :ref:`alpha_scissor_threshold<class_SpriteBase3D_property_alpha_scissor_threshold>` | ``0.5`` |
  31. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  32. | :ref:`Axis<enum_Vector3_Axis>` | :ref:`axis<class_SpriteBase3D_property_axis>` | ``2`` |
  33. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  34. | :ref:`BillboardMode<enum_BaseMaterial3D_BillboardMode>` | :ref:`billboard<class_SpriteBase3D_property_billboard>` | ``0`` |
  35. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  36. | :ref:`bool<class_bool>` | :ref:`centered<class_SpriteBase3D_property_centered>` | ``true`` |
  37. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  38. | :ref:`bool<class_bool>` | :ref:`double_sided<class_SpriteBase3D_property_double_sided>` | ``true`` |
  39. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  40. | :ref:`bool<class_bool>` | :ref:`fixed_size<class_SpriteBase3D_property_fixed_size>` | ``false`` |
  41. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  42. | :ref:`bool<class_bool>` | :ref:`flip_h<class_SpriteBase3D_property_flip_h>` | ``false`` |
  43. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  44. | :ref:`bool<class_bool>` | :ref:`flip_v<class_SpriteBase3D_property_flip_v>` | ``false`` |
  45. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  46. | :ref:`Color<class_Color>` | :ref:`modulate<class_SpriteBase3D_property_modulate>` | ``Color(1, 1, 1, 1)`` |
  47. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  48. | :ref:`bool<class_bool>` | :ref:`no_depth_test<class_SpriteBase3D_property_no_depth_test>` | ``false`` |
  49. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  50. | :ref:`Vector2<class_Vector2>` | :ref:`offset<class_SpriteBase3D_property_offset>` | ``Vector2(0, 0)`` |
  51. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  52. | :ref:`float<class_float>` | :ref:`pixel_size<class_SpriteBase3D_property_pixel_size>` | ``0.01`` |
  53. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  54. | :ref:`int<class_int>` | :ref:`render_priority<class_SpriteBase3D_property_render_priority>` | ``0`` |
  55. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  56. | :ref:`bool<class_bool>` | :ref:`shaded<class_SpriteBase3D_property_shaded>` | ``false`` |
  57. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  58. | :ref:`TextureFilter<enum_BaseMaterial3D_TextureFilter>` | :ref:`texture_filter<class_SpriteBase3D_property_texture_filter>` | ``3`` |
  59. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  60. | :ref:`bool<class_bool>` | :ref:`transparent<class_SpriteBase3D_property_transparent>` | ``true`` |
  61. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------+
  62. .. rst-class:: classref-reftable-group
  63. Methods
  64. -------
  65. .. table::
  66. :widths: auto
  67. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`TriangleMesh<class_TriangleMesh>` | :ref:`generate_triangle_mesh<class_SpriteBase3D_method_generate_triangle_mesh>`\ (\ ) |const| |
  69. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`bool<class_bool>` | :ref:`get_draw_flag<class_SpriteBase3D_method_get_draw_flag>`\ (\ flag\: :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>`\ ) |const| |
  71. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`Rect2<class_Rect2>` | :ref:`get_item_rect<class_SpriteBase3D_method_get_item_rect>`\ (\ ) |const| |
  73. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | |void| | :ref:`set_draw_flag<class_SpriteBase3D_method_set_draw_flag>`\ (\ flag\: :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>`, enabled\: :ref:`bool<class_bool>`\ ) |
  75. +-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. .. rst-class:: classref-section-separator
  77. ----
  78. .. rst-class:: classref-descriptions-group
  79. Enumerations
  80. ------------
  81. .. _enum_SpriteBase3D_DrawFlags:
  82. .. rst-class:: classref-enumeration
  83. enum **DrawFlags**: :ref:`🔗<enum_SpriteBase3D_DrawFlags>`
  84. .. _class_SpriteBase3D_constant_FLAG_TRANSPARENT:
  85. .. rst-class:: classref-enumeration-constant
  86. :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>` **FLAG_TRANSPARENT** = ``0``
  87. If set, the texture's transparency and the opacity are used to make those parts of the sprite invisible.
  88. .. _class_SpriteBase3D_constant_FLAG_SHADED:
  89. .. rst-class:: classref-enumeration-constant
  90. :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>` **FLAG_SHADED** = ``1``
  91. If set, lights in the environment affect the sprite.
  92. .. _class_SpriteBase3D_constant_FLAG_DOUBLE_SIDED:
  93. .. rst-class:: classref-enumeration-constant
  94. :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>` **FLAG_DOUBLE_SIDED** = ``2``
  95. If set, texture can be seen from the back as well. If not, the texture is invisible when looking at it from behind.
  96. .. _class_SpriteBase3D_constant_FLAG_DISABLE_DEPTH_TEST:
  97. .. rst-class:: classref-enumeration-constant
  98. :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>` **FLAG_DISABLE_DEPTH_TEST** = ``3``
  99. 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.
  100. .. _class_SpriteBase3D_constant_FLAG_FIXED_SIZE:
  101. .. rst-class:: classref-enumeration-constant
  102. :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>` **FLAG_FIXED_SIZE** = ``4``
  103. Label is scaled by depth so that it always appears the same size on screen.
  104. .. _class_SpriteBase3D_constant_FLAG_MAX:
  105. .. rst-class:: classref-enumeration-constant
  106. :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>` **FLAG_MAX** = ``5``
  107. Represents the size of the :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>` enum.
  108. .. rst-class:: classref-item-separator
  109. ----
  110. .. _enum_SpriteBase3D_AlphaCutMode:
  111. .. rst-class:: classref-enumeration
  112. enum **AlphaCutMode**: :ref:`🔗<enum_SpriteBase3D_AlphaCutMode>`
  113. .. _class_SpriteBase3D_constant_ALPHA_CUT_DISABLED:
  114. .. rst-class:: classref-enumeration-constant
  115. :ref:`AlphaCutMode<enum_SpriteBase3D_AlphaCutMode>` **ALPHA_CUT_DISABLED** = ``0``
  116. This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping.
  117. .. _class_SpriteBase3D_constant_ALPHA_CUT_DISCARD:
  118. .. rst-class:: classref-enumeration-constant
  119. :ref:`AlphaCutMode<enum_SpriteBase3D_AlphaCutMode>` **ALPHA_CUT_DISCARD** = ``1``
  120. 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>`). On the bright side, this mode doesn't suffer from transparency sorting issues when multiple transparent materials are overlapping. This mode is also known as *alpha testing* or *1-bit transparency*.
  121. .. _class_SpriteBase3D_constant_ALPHA_CUT_OPAQUE_PREPASS:
  122. .. rst-class:: classref-enumeration-constant
  123. :ref:`AlphaCutMode<enum_SpriteBase3D_AlphaCutMode>` **ALPHA_CUT_OPAQUE_PREPASS** = ``2``
  124. This mode draws fully opaque pixels in the depth prepass. This is slower than :ref:`ALPHA_CUT_DISABLED<class_SpriteBase3D_constant_ALPHA_CUT_DISABLED>` or :ref:`ALPHA_CUT_DISCARD<class_SpriteBase3D_constant_ALPHA_CUT_DISCARD>`, but it allows displaying translucent areas and smooth edges while using proper sorting.
  125. .. _class_SpriteBase3D_constant_ALPHA_CUT_HASH:
  126. .. rst-class:: classref-enumeration-constant
  127. :ref:`AlphaCutMode<enum_SpriteBase3D_AlphaCutMode>` **ALPHA_CUT_HASH** = ``3``
  128. This mode draws cuts off all values below a spatially-deterministic threshold, the rest will remain opaque.
  129. .. rst-class:: classref-section-separator
  130. ----
  131. .. rst-class:: classref-descriptions-group
  132. Property Descriptions
  133. ---------------------
  134. .. _class_SpriteBase3D_property_alpha_antialiasing_edge:
  135. .. rst-class:: classref-property
  136. :ref:`float<class_float>` **alpha_antialiasing_edge** = ``0.0`` :ref:`🔗<class_SpriteBase3D_property_alpha_antialiasing_edge>`
  137. .. rst-class:: classref-property-setget
  138. - |void| **set_alpha_antialiasing_edge**\ (\ value\: :ref:`float<class_float>`\ )
  139. - :ref:`float<class_float>` **get_alpha_antialiasing_edge**\ (\ )
  140. Threshold at which antialiasing will be applied on the alpha channel.
  141. .. rst-class:: classref-item-separator
  142. ----
  143. .. _class_SpriteBase3D_property_alpha_antialiasing_mode:
  144. .. rst-class:: classref-property
  145. :ref:`AlphaAntiAliasing<enum_BaseMaterial3D_AlphaAntiAliasing>` **alpha_antialiasing_mode** = ``0`` :ref:`🔗<class_SpriteBase3D_property_alpha_antialiasing_mode>`
  146. .. rst-class:: classref-property-setget
  147. - |void| **set_alpha_antialiasing**\ (\ value\: :ref:`AlphaAntiAliasing<enum_BaseMaterial3D_AlphaAntiAliasing>`\ )
  148. - :ref:`AlphaAntiAliasing<enum_BaseMaterial3D_AlphaAntiAliasing>` **get_alpha_antialiasing**\ (\ )
  149. The type of alpha antialiasing to apply.
  150. .. rst-class:: classref-item-separator
  151. ----
  152. .. _class_SpriteBase3D_property_alpha_cut:
  153. .. rst-class:: classref-property
  154. :ref:`AlphaCutMode<enum_SpriteBase3D_AlphaCutMode>` **alpha_cut** = ``0`` :ref:`🔗<class_SpriteBase3D_property_alpha_cut>`
  155. .. rst-class:: classref-property-setget
  156. - |void| **set_alpha_cut_mode**\ (\ value\: :ref:`AlphaCutMode<enum_SpriteBase3D_AlphaCutMode>`\ )
  157. - :ref:`AlphaCutMode<enum_SpriteBase3D_AlphaCutMode>` **get_alpha_cut_mode**\ (\ )
  158. The alpha cutting mode to use for the sprite.
  159. .. rst-class:: classref-item-separator
  160. ----
  161. .. _class_SpriteBase3D_property_alpha_hash_scale:
  162. .. rst-class:: classref-property
  163. :ref:`float<class_float>` **alpha_hash_scale** = ``1.0`` :ref:`🔗<class_SpriteBase3D_property_alpha_hash_scale>`
  164. .. rst-class:: classref-property-setget
  165. - |void| **set_alpha_hash_scale**\ (\ value\: :ref:`float<class_float>`\ )
  166. - :ref:`float<class_float>` **get_alpha_hash_scale**\ (\ )
  167. The hashing scale for Alpha Hash. Recommended values between ``0`` and ``2``.
  168. .. rst-class:: classref-item-separator
  169. ----
  170. .. _class_SpriteBase3D_property_alpha_scissor_threshold:
  171. .. rst-class:: classref-property
  172. :ref:`float<class_float>` **alpha_scissor_threshold** = ``0.5`` :ref:`🔗<class_SpriteBase3D_property_alpha_scissor_threshold>`
  173. .. rst-class:: classref-property-setget
  174. - |void| **set_alpha_scissor_threshold**\ (\ value\: :ref:`float<class_float>`\ )
  175. - :ref:`float<class_float>` **get_alpha_scissor_threshold**\ (\ )
  176. Threshold at which the alpha scissor will discard values.
  177. .. rst-class:: classref-item-separator
  178. ----
  179. .. _class_SpriteBase3D_property_axis:
  180. .. rst-class:: classref-property
  181. :ref:`Axis<enum_Vector3_Axis>` **axis** = ``2`` :ref:`🔗<class_SpriteBase3D_property_axis>`
  182. .. rst-class:: classref-property-setget
  183. - |void| **set_axis**\ (\ value\: :ref:`Axis<enum_Vector3_Axis>`\ )
  184. - :ref:`Axis<enum_Vector3_Axis>` **get_axis**\ (\ )
  185. The direction in which the front of the texture faces.
  186. .. rst-class:: classref-item-separator
  187. ----
  188. .. _class_SpriteBase3D_property_billboard:
  189. .. rst-class:: classref-property
  190. :ref:`BillboardMode<enum_BaseMaterial3D_BillboardMode>` **billboard** = ``0`` :ref:`🔗<class_SpriteBase3D_property_billboard>`
  191. .. rst-class:: classref-property-setget
  192. - |void| **set_billboard_mode**\ (\ value\: :ref:`BillboardMode<enum_BaseMaterial3D_BillboardMode>`\ )
  193. - :ref:`BillboardMode<enum_BaseMaterial3D_BillboardMode>` **get_billboard_mode**\ (\ )
  194. The billboard mode to use for the sprite.
  195. \ **Note:** When billboarding is enabled and the material also casts shadows, billboards will face **the** camera in the scene when rendering shadows. In scenes with multiple cameras, the intended shadow cannot be determined and this will result in undefined behavior. See `GitHub Pull Request #72638 <https://github.com/godotengine/godot/pull/72638>`__ for details.
  196. .. rst-class:: classref-item-separator
  197. ----
  198. .. _class_SpriteBase3D_property_centered:
  199. .. rst-class:: classref-property
  200. :ref:`bool<class_bool>` **centered** = ``true`` :ref:`🔗<class_SpriteBase3D_property_centered>`
  201. .. rst-class:: classref-property-setget
  202. - |void| **set_centered**\ (\ value\: :ref:`bool<class_bool>`\ )
  203. - :ref:`bool<class_bool>` **is_centered**\ (\ )
  204. If ``true``, texture will be centered.
  205. .. rst-class:: classref-item-separator
  206. ----
  207. .. _class_SpriteBase3D_property_double_sided:
  208. .. rst-class:: classref-property
  209. :ref:`bool<class_bool>` **double_sided** = ``true`` :ref:`🔗<class_SpriteBase3D_property_double_sided>`
  210. .. rst-class:: classref-property-setget
  211. - |void| **set_draw_flag**\ (\ flag\: :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>`, enabled\: :ref:`bool<class_bool>`\ )
  212. - :ref:`bool<class_bool>` **get_draw_flag**\ (\ flag\: :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>`\ ) |const|
  213. If ``true``, texture can be seen from the back as well, if ``false``, it is invisible when looking at it from behind.
  214. .. rst-class:: classref-item-separator
  215. ----
  216. .. _class_SpriteBase3D_property_fixed_size:
  217. .. rst-class:: classref-property
  218. :ref:`bool<class_bool>` **fixed_size** = ``false`` :ref:`🔗<class_SpriteBase3D_property_fixed_size>`
  219. .. rst-class:: classref-property-setget
  220. - |void| **set_draw_flag**\ (\ flag\: :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>`, enabled\: :ref:`bool<class_bool>`\ )
  221. - :ref:`bool<class_bool>` **get_draw_flag**\ (\ flag\: :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>`\ ) |const|
  222. If ``true``, the texture is rendered at the same size regardless of distance. The texture's size on screen is the same as if the camera was ``1.0`` units away from the texture's origin, regardless of the actual distance from the camera. The :ref:`Camera3D<class_Camera3D>`'s field of view (or :ref:`Camera3D.size<class_Camera3D_property_size>` when in orthogonal/frustum mode) still affects the size the sprite is drawn at.
  223. .. rst-class:: classref-item-separator
  224. ----
  225. .. _class_SpriteBase3D_property_flip_h:
  226. .. rst-class:: classref-property
  227. :ref:`bool<class_bool>` **flip_h** = ``false`` :ref:`🔗<class_SpriteBase3D_property_flip_h>`
  228. .. rst-class:: classref-property-setget
  229. - |void| **set_flip_h**\ (\ value\: :ref:`bool<class_bool>`\ )
  230. - :ref:`bool<class_bool>` **is_flipped_h**\ (\ )
  231. If ``true``, texture is flipped horizontally.
  232. .. rst-class:: classref-item-separator
  233. ----
  234. .. _class_SpriteBase3D_property_flip_v:
  235. .. rst-class:: classref-property
  236. :ref:`bool<class_bool>` **flip_v** = ``false`` :ref:`🔗<class_SpriteBase3D_property_flip_v>`
  237. .. rst-class:: classref-property-setget
  238. - |void| **set_flip_v**\ (\ value\: :ref:`bool<class_bool>`\ )
  239. - :ref:`bool<class_bool>` **is_flipped_v**\ (\ )
  240. If ``true``, texture is flipped vertically.
  241. .. rst-class:: classref-item-separator
  242. ----
  243. .. _class_SpriteBase3D_property_modulate:
  244. .. rst-class:: classref-property
  245. :ref:`Color<class_Color>` **modulate** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_SpriteBase3D_property_modulate>`
  246. .. rst-class:: classref-property-setget
  247. - |void| **set_modulate**\ (\ value\: :ref:`Color<class_Color>`\ )
  248. - :ref:`Color<class_Color>` **get_modulate**\ (\ )
  249. A color value used to *multiply* the texture's colors. Can be used for mood-coloring or to simulate the color of ambient light.
  250. \ **Note:** Unlike :ref:`CanvasItem.modulate<class_CanvasItem_property_modulate>` for 2D, colors with values above ``1.0`` (overbright) are not supported.
  251. \ **Note:** If a :ref:`GeometryInstance3D.material_override<class_GeometryInstance3D_property_material_override>` is defined on the **SpriteBase3D**, the material override must be configured to take vertex colors into account for albedo. Otherwise, the color defined in :ref:`modulate<class_SpriteBase3D_property_modulate>` will be ignored. For a :ref:`BaseMaterial3D<class_BaseMaterial3D>`, :ref:`BaseMaterial3D.vertex_color_use_as_albedo<class_BaseMaterial3D_property_vertex_color_use_as_albedo>` must be ``true``. For a :ref:`ShaderMaterial<class_ShaderMaterial>`, ``ALBEDO *= COLOR.rgb;`` must be inserted in the shader's ``fragment()`` function.
  252. .. rst-class:: classref-item-separator
  253. ----
  254. .. _class_SpriteBase3D_property_no_depth_test:
  255. .. rst-class:: classref-property
  256. :ref:`bool<class_bool>` **no_depth_test** = ``false`` :ref:`🔗<class_SpriteBase3D_property_no_depth_test>`
  257. .. rst-class:: classref-property-setget
  258. - |void| **set_draw_flag**\ (\ flag\: :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>`, enabled\: :ref:`bool<class_bool>`\ )
  259. - :ref:`bool<class_bool>` **get_draw_flag**\ (\ flag\: :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>`\ ) |const|
  260. If ``true``, depth testing is disabled and the object will be drawn in render order.
  261. .. rst-class:: classref-item-separator
  262. ----
  263. .. _class_SpriteBase3D_property_offset:
  264. .. rst-class:: classref-property
  265. :ref:`Vector2<class_Vector2>` **offset** = ``Vector2(0, 0)`` :ref:`🔗<class_SpriteBase3D_property_offset>`
  266. .. rst-class:: classref-property-setget
  267. - |void| **set_offset**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  268. - :ref:`Vector2<class_Vector2>` **get_offset**\ (\ )
  269. The texture's drawing offset.
  270. \ **Note:** When you increase :ref:`offset<class_SpriteBase3D_property_offset>`.y in Sprite3D, the sprite moves upward in world space (i.e., +Y is up).
  271. .. rst-class:: classref-item-separator
  272. ----
  273. .. _class_SpriteBase3D_property_pixel_size:
  274. .. rst-class:: classref-property
  275. :ref:`float<class_float>` **pixel_size** = ``0.01`` :ref:`🔗<class_SpriteBase3D_property_pixel_size>`
  276. .. rst-class:: classref-property-setget
  277. - |void| **set_pixel_size**\ (\ value\: :ref:`float<class_float>`\ )
  278. - :ref:`float<class_float>` **get_pixel_size**\ (\ )
  279. The size of one pixel's width on the sprite to scale it in 3D.
  280. .. rst-class:: classref-item-separator
  281. ----
  282. .. _class_SpriteBase3D_property_render_priority:
  283. .. rst-class:: classref-property
  284. :ref:`int<class_int>` **render_priority** = ``0`` :ref:`🔗<class_SpriteBase3D_property_render_priority>`
  285. .. rst-class:: classref-property-setget
  286. - |void| **set_render_priority**\ (\ value\: :ref:`int<class_int>`\ )
  287. - :ref:`int<class_int>` **get_render_priority**\ (\ )
  288. Sets the render priority for the sprite. Higher priority objects will be sorted in front of lower priority objects.
  289. \ **Note:** This only applies if :ref:`alpha_cut<class_SpriteBase3D_property_alpha_cut>` is set to :ref:`ALPHA_CUT_DISABLED<class_SpriteBase3D_constant_ALPHA_CUT_DISABLED>` (default value).
  290. \ **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).
  291. .. rst-class:: classref-item-separator
  292. ----
  293. .. _class_SpriteBase3D_property_shaded:
  294. .. rst-class:: classref-property
  295. :ref:`bool<class_bool>` **shaded** = ``false`` :ref:`🔗<class_SpriteBase3D_property_shaded>`
  296. .. rst-class:: classref-property-setget
  297. - |void| **set_draw_flag**\ (\ flag\: :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>`, enabled\: :ref:`bool<class_bool>`\ )
  298. - :ref:`bool<class_bool>` **get_draw_flag**\ (\ flag\: :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>`\ ) |const|
  299. If ``true``, the :ref:`Light3D<class_Light3D>` in the :ref:`Environment<class_Environment>` has effects on the sprite.
  300. .. rst-class:: classref-item-separator
  301. ----
  302. .. _class_SpriteBase3D_property_texture_filter:
  303. .. rst-class:: classref-property
  304. :ref:`TextureFilter<enum_BaseMaterial3D_TextureFilter>` **texture_filter** = ``3`` :ref:`🔗<class_SpriteBase3D_property_texture_filter>`
  305. .. rst-class:: classref-property-setget
  306. - |void| **set_texture_filter**\ (\ value\: :ref:`TextureFilter<enum_BaseMaterial3D_TextureFilter>`\ )
  307. - :ref:`TextureFilter<enum_BaseMaterial3D_TextureFilter>` **get_texture_filter**\ (\ )
  308. Filter flags for the texture.
  309. \ **Note:** Linear filtering may cause artifacts around the edges, which are especially noticeable on opaque textures. To prevent this, use textures with transparent or identical colors around the edges.
  310. .. rst-class:: classref-item-separator
  311. ----
  312. .. _class_SpriteBase3D_property_transparent:
  313. .. rst-class:: classref-property
  314. :ref:`bool<class_bool>` **transparent** = ``true`` :ref:`🔗<class_SpriteBase3D_property_transparent>`
  315. .. rst-class:: classref-property-setget
  316. - |void| **set_draw_flag**\ (\ flag\: :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>`, enabled\: :ref:`bool<class_bool>`\ )
  317. - :ref:`bool<class_bool>` **get_draw_flag**\ (\ flag\: :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>`\ ) |const|
  318. If ``true``, the texture's transparency and the opacity are used to make those parts of the sprite invisible.
  319. .. rst-class:: classref-section-separator
  320. ----
  321. .. rst-class:: classref-descriptions-group
  322. Method Descriptions
  323. -------------------
  324. .. _class_SpriteBase3D_method_generate_triangle_mesh:
  325. .. rst-class:: classref-method
  326. :ref:`TriangleMesh<class_TriangleMesh>` **generate_triangle_mesh**\ (\ ) |const| :ref:`🔗<class_SpriteBase3D_method_generate_triangle_mesh>`
  327. Returns a :ref:`TriangleMesh<class_TriangleMesh>` with the sprite's vertices following its current configuration (such as its :ref:`axis<class_SpriteBase3D_property_axis>` and :ref:`pixel_size<class_SpriteBase3D_property_pixel_size>`).
  328. .. rst-class:: classref-item-separator
  329. ----
  330. .. _class_SpriteBase3D_method_get_draw_flag:
  331. .. rst-class:: classref-method
  332. :ref:`bool<class_bool>` **get_draw_flag**\ (\ flag\: :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>`\ ) |const| :ref:`🔗<class_SpriteBase3D_method_get_draw_flag>`
  333. Returns the value of the specified flag.
  334. .. rst-class:: classref-item-separator
  335. ----
  336. .. _class_SpriteBase3D_method_get_item_rect:
  337. .. rst-class:: classref-method
  338. :ref:`Rect2<class_Rect2>` **get_item_rect**\ (\ ) |const| :ref:`🔗<class_SpriteBase3D_method_get_item_rect>`
  339. Returns the rectangle representing this sprite.
  340. .. rst-class:: classref-item-separator
  341. ----
  342. .. _class_SpriteBase3D_method_set_draw_flag:
  343. .. rst-class:: classref-method
  344. |void| **set_draw_flag**\ (\ flag\: :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_SpriteBase3D_method_set_draw_flag>`
  345. If ``true``, the specified flag will be enabled.
  346. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  347. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  348. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  349. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  350. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  351. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  352. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  353. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  354. .. |void| replace:: :abbr:`void (No return value.)`