class_spritebase3d.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the SpriteBase3D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_SpriteBase3D:
  6. SpriteBase3D
  7. ============
  8. **Inherits:** :ref:`GeometryInstance<class_GeometryInstance>` **<** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Inherited By:** :ref:`AnimatedSprite3D<class_AnimatedSprite3D>`, :ref:`Sprite3D<class_Sprite3D>`
  10. **Category:** Core
  11. Brief Description
  12. -----------------
  13. 2D sprite node in 3D environment.
  14. Properties
  15. ----------
  16. +----------------------------------------------------------+---------------------------------------------------------------+---------------------+
  17. | :ref:`AlphaCutMode<enum_SpriteBase3D_AlphaCutMode>` | :ref:`alpha_cut<class_SpriteBase3D_property_alpha_cut>` | 0 |
  18. +----------------------------------------------------------+---------------------------------------------------------------+---------------------+
  19. | Vector3.Axis | :ref:`axis<class_SpriteBase3D_property_axis>` | 2 |
  20. +----------------------------------------------------------+---------------------------------------------------------------+---------------------+
  21. | :ref:`BillboardMode<enum_SpatialMaterial_BillboardMode>` | :ref:`billboard<class_SpriteBase3D_property_billboard>` | 0 |
  22. +----------------------------------------------------------+---------------------------------------------------------------+---------------------+
  23. | :ref:`bool<class_bool>` | :ref:`centered<class_SpriteBase3D_property_centered>` | true |
  24. +----------------------------------------------------------+---------------------------------------------------------------+---------------------+
  25. | :ref:`bool<class_bool>` | :ref:`double_sided<class_SpriteBase3D_property_double_sided>` | true |
  26. +----------------------------------------------------------+---------------------------------------------------------------+---------------------+
  27. | :ref:`bool<class_bool>` | :ref:`flip_h<class_SpriteBase3D_property_flip_h>` | false |
  28. +----------------------------------------------------------+---------------------------------------------------------------+---------------------+
  29. | :ref:`bool<class_bool>` | :ref:`flip_v<class_SpriteBase3D_property_flip_v>` | false |
  30. +----------------------------------------------------------+---------------------------------------------------------------+---------------------+
  31. | :ref:`Color<class_Color>` | :ref:`modulate<class_SpriteBase3D_property_modulate>` | Color( 1, 1, 1, 1 ) |
  32. +----------------------------------------------------------+---------------------------------------------------------------+---------------------+
  33. | :ref:`Vector2<class_Vector2>` | :ref:`offset<class_SpriteBase3D_property_offset>` | Vector2( 0, 0 ) |
  34. +----------------------------------------------------------+---------------------------------------------------------------+---------------------+
  35. | :ref:`float<class_float>` | :ref:`opacity<class_SpriteBase3D_property_opacity>` | 1.0 |
  36. +----------------------------------------------------------+---------------------------------------------------------------+---------------------+
  37. | :ref:`float<class_float>` | :ref:`pixel_size<class_SpriteBase3D_property_pixel_size>` | 0.01 |
  38. +----------------------------------------------------------+---------------------------------------------------------------+---------------------+
  39. | :ref:`bool<class_bool>` | :ref:`shaded<class_SpriteBase3D_property_shaded>` | false |
  40. +----------------------------------------------------------+---------------------------------------------------------------+---------------------+
  41. | :ref:`bool<class_bool>` | :ref:`transparent<class_SpriteBase3D_property_transparent>` | true |
  42. +----------------------------------------------------------+---------------------------------------------------------------+---------------------+
  43. Methods
  44. -------
  45. +-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`TriangleMesh<class_TriangleMesh>` | :ref:`generate_triangle_mesh<class_SpriteBase3D_method_generate_triangle_mesh>` **(** **)** const |
  47. +-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`bool<class_bool>` | :ref:`get_draw_flag<class_SpriteBase3D_method_get_draw_flag>` **(** :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>` flag **)** const |
  49. +-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`Rect2<class_Rect2>` | :ref:`get_item_rect<class_SpriteBase3D_method_get_item_rect>` **(** **)** const |
  51. +-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | void | :ref:`set_draw_flag<class_SpriteBase3D_method_set_draw_flag>` **(** :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>` flag, :ref:`bool<class_bool>` enabled **)** |
  53. +-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. Enumerations
  55. ------------
  56. .. _enum_SpriteBase3D_DrawFlags:
  57. .. _class_SpriteBase3D_constant_FLAG_TRANSPARENT:
  58. .. _class_SpriteBase3D_constant_FLAG_SHADED:
  59. .. _class_SpriteBase3D_constant_FLAG_DOUBLE_SIDED:
  60. .. _class_SpriteBase3D_constant_FLAG_MAX:
  61. enum **DrawFlags**:
  62. - **FLAG_TRANSPARENT** = **0** --- If set, the texture's transparency and the opacity are used to make those parts of the sprite invisible.
  63. - **FLAG_SHADED** = **1** --- If set, lights in the environment affect the sprite.
  64. - **FLAG_DOUBLE_SIDED** = **2** --- If set, texture can be seen from the back as well, if not, it is invisible when looking at it from behind.
  65. - **FLAG_MAX** = **3** --- Represents the size of the :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>` enum.
  66. .. _enum_SpriteBase3D_AlphaCutMode:
  67. .. _class_SpriteBase3D_constant_ALPHA_CUT_DISABLED:
  68. .. _class_SpriteBase3D_constant_ALPHA_CUT_DISCARD:
  69. .. _class_SpriteBase3D_constant_ALPHA_CUT_OPAQUE_PREPASS:
  70. enum **AlphaCutMode**:
  71. - **ALPHA_CUT_DISABLED** = **0**
  72. - **ALPHA_CUT_DISCARD** = **1**
  73. - **ALPHA_CUT_OPAQUE_PREPASS** = **2**
  74. Description
  75. -----------
  76. A node that displays 2D texture information in a 3D environment.
  77. Property Descriptions
  78. ---------------------
  79. .. _class_SpriteBase3D_property_alpha_cut:
  80. - :ref:`AlphaCutMode<enum_SpriteBase3D_AlphaCutMode>` **alpha_cut**
  81. +-----------+---------------------------+
  82. | *Default* | 0 |
  83. +-----------+---------------------------+
  84. | *Setter* | set_alpha_cut_mode(value) |
  85. +-----------+---------------------------+
  86. | *Getter* | get_alpha_cut_mode() |
  87. +-----------+---------------------------+
  88. .. _class_SpriteBase3D_property_axis:
  89. - Vector3.Axis **axis**
  90. +-----------+-----------------+
  91. | *Default* | 2 |
  92. +-----------+-----------------+
  93. | *Setter* | set_axis(value) |
  94. +-----------+-----------------+
  95. | *Getter* | get_axis() |
  96. +-----------+-----------------+
  97. The direction in which the front of the texture faces.
  98. .. _class_SpriteBase3D_property_billboard:
  99. - :ref:`BillboardMode<enum_SpatialMaterial_BillboardMode>` **billboard**
  100. +-----------+---------------------------+
  101. | *Default* | 0 |
  102. +-----------+---------------------------+
  103. | *Setter* | set_billboard_mode(value) |
  104. +-----------+---------------------------+
  105. | *Getter* | get_billboard_mode() |
  106. +-----------+---------------------------+
  107. .. _class_SpriteBase3D_property_centered:
  108. - :ref:`bool<class_bool>` **centered**
  109. +-----------+---------------------+
  110. | *Default* | true |
  111. +-----------+---------------------+
  112. | *Setter* | set_centered(value) |
  113. +-----------+---------------------+
  114. | *Getter* | is_centered() |
  115. +-----------+---------------------+
  116. If ``true``, texture will be centered.
  117. .. _class_SpriteBase3D_property_double_sided:
  118. - :ref:`bool<class_bool>` **double_sided**
  119. +-----------+----------------------+
  120. | *Default* | true |
  121. +-----------+----------------------+
  122. | *Setter* | set_draw_flag(value) |
  123. +-----------+----------------------+
  124. | *Getter* | get_draw_flag() |
  125. +-----------+----------------------+
  126. If ``true``, texture can be seen from the back as well, if ``false``, it is invisible when looking at it from behind.
  127. .. _class_SpriteBase3D_property_flip_h:
  128. - :ref:`bool<class_bool>` **flip_h**
  129. +-----------+-------------------+
  130. | *Default* | false |
  131. +-----------+-------------------+
  132. | *Setter* | set_flip_h(value) |
  133. +-----------+-------------------+
  134. | *Getter* | is_flipped_h() |
  135. +-----------+-------------------+
  136. If ``true``, texture is flipped horizontally.
  137. .. _class_SpriteBase3D_property_flip_v:
  138. - :ref:`bool<class_bool>` **flip_v**
  139. +-----------+-------------------+
  140. | *Default* | false |
  141. +-----------+-------------------+
  142. | *Setter* | set_flip_v(value) |
  143. +-----------+-------------------+
  144. | *Getter* | is_flipped_v() |
  145. +-----------+-------------------+
  146. If ``true``, texture is flipped vertically.
  147. .. _class_SpriteBase3D_property_modulate:
  148. - :ref:`Color<class_Color>` **modulate**
  149. +-----------+---------------------+
  150. | *Default* | Color( 1, 1, 1, 1 ) |
  151. +-----------+---------------------+
  152. | *Setter* | set_modulate(value) |
  153. +-----------+---------------------+
  154. | *Getter* | get_modulate() |
  155. +-----------+---------------------+
  156. A color value that gets multiplied on, could be used for mood-coloring or to simulate the color of light.
  157. .. _class_SpriteBase3D_property_offset:
  158. - :ref:`Vector2<class_Vector2>` **offset**
  159. +-----------+-------------------+
  160. | *Default* | Vector2( 0, 0 ) |
  161. +-----------+-------------------+
  162. | *Setter* | set_offset(value) |
  163. +-----------+-------------------+
  164. | *Getter* | get_offset() |
  165. +-----------+-------------------+
  166. The texture's drawing offset.
  167. .. _class_SpriteBase3D_property_opacity:
  168. - :ref:`float<class_float>` **opacity**
  169. +-----------+--------------------+
  170. | *Default* | 1.0 |
  171. +-----------+--------------------+
  172. | *Setter* | set_opacity(value) |
  173. +-----------+--------------------+
  174. | *Getter* | get_opacity() |
  175. +-----------+--------------------+
  176. The objects visibility on a scale from ``0`` fully invisible to ``1`` fully visible.
  177. .. _class_SpriteBase3D_property_pixel_size:
  178. - :ref:`float<class_float>` **pixel_size**
  179. +-----------+-----------------------+
  180. | *Default* | 0.01 |
  181. +-----------+-----------------------+
  182. | *Setter* | set_pixel_size(value) |
  183. +-----------+-----------------------+
  184. | *Getter* | get_pixel_size() |
  185. +-----------+-----------------------+
  186. The size of one pixel's width on the sprite to scale it in 3D.
  187. .. _class_SpriteBase3D_property_shaded:
  188. - :ref:`bool<class_bool>` **shaded**
  189. +-----------+----------------------+
  190. | *Default* | false |
  191. +-----------+----------------------+
  192. | *Setter* | set_draw_flag(value) |
  193. +-----------+----------------------+
  194. | *Getter* | get_draw_flag() |
  195. +-----------+----------------------+
  196. If ``true``, the :ref:`Light<class_Light>` in the :ref:`Environment<class_Environment>` has effects on the sprite.
  197. .. _class_SpriteBase3D_property_transparent:
  198. - :ref:`bool<class_bool>` **transparent**
  199. +-----------+----------------------+
  200. | *Default* | true |
  201. +-----------+----------------------+
  202. | *Setter* | set_draw_flag(value) |
  203. +-----------+----------------------+
  204. | *Getter* | get_draw_flag() |
  205. +-----------+----------------------+
  206. If ``true``, the texture's transparency and the opacity are used to make those parts of the sprite invisible.
  207. Method Descriptions
  208. -------------------
  209. .. _class_SpriteBase3D_method_generate_triangle_mesh:
  210. - :ref:`TriangleMesh<class_TriangleMesh>` **generate_triangle_mesh** **(** **)** const
  211. .. _class_SpriteBase3D_method_get_draw_flag:
  212. - :ref:`bool<class_bool>` **get_draw_flag** **(** :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>` flag **)** const
  213. .. _class_SpriteBase3D_method_get_item_rect:
  214. - :ref:`Rect2<class_Rect2>` **get_item_rect** **(** **)** const
  215. .. _class_SpriteBase3D_method_set_draw_flag:
  216. - void **set_draw_flag** **(** :ref:`DrawFlags<enum_SpriteBase3D_DrawFlags>` flag, :ref:`bool<class_bool>` enabled **)**