class_sprite3d.rst 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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 Sprite3D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_Sprite3D:
  6. Sprite3D
  7. ========
  8. **Inherits:** :ref:`SpriteBase3D<class_SpriteBase3D>` **<** :ref:`GeometryInstance<class_GeometryInstance>` **<** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. 2D sprite node in a 3D world.
  10. Description
  11. -----------
  12. A node that displays a 2D texture in a 3D environment. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation.
  13. **Note:** There are `known performance issues <https://github.com/godotengine/godot/issues/20855>`_ when using ``Sprite3D``. Consider using a :ref:`MeshInstance<class_MeshInstance>` with a :ref:`QuadMesh<class_QuadMesh>` as the mesh instead. You can still have billboarding by enabling billboard properties in the QuadMesh's :ref:`StandardMaterial3D<class_StandardMaterial3D>`.
  14. Properties
  15. ----------
  16. +-----------------------------------+---------------------------------------------------------------+-------------------------+
  17. | :ref:`int<class_int>` | :ref:`frame<class_Sprite3D_property_frame>` | ``0`` |
  18. +-----------------------------------+---------------------------------------------------------------+-------------------------+
  19. | :ref:`Vector2<class_Vector2>` | :ref:`frame_coords<class_Sprite3D_property_frame_coords>` | ``Vector2( 0, 0 )`` |
  20. +-----------------------------------+---------------------------------------------------------------+-------------------------+
  21. | :ref:`int<class_int>` | :ref:`hframes<class_Sprite3D_property_hframes>` | ``1`` |
  22. +-----------------------------------+---------------------------------------------------------------+-------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`region_enabled<class_Sprite3D_property_region_enabled>` | ``false`` |
  24. +-----------------------------------+---------------------------------------------------------------+-------------------------+
  25. | :ref:`Rect2<class_Rect2>` | :ref:`region_rect<class_Sprite3D_property_region_rect>` | ``Rect2( 0, 0, 0, 0 )`` |
  26. +-----------------------------------+---------------------------------------------------------------+-------------------------+
  27. | :ref:`Texture2D<class_Texture2D>` | :ref:`texture<class_Sprite3D_property_texture>` | |
  28. +-----------------------------------+---------------------------------------------------------------+-------------------------+
  29. | :ref:`int<class_int>` | :ref:`vframes<class_Sprite3D_property_vframes>` | ``1`` |
  30. +-----------------------------------+---------------------------------------------------------------+-------------------------+
  31. Signals
  32. -------
  33. .. _class_Sprite3D_signal_frame_changed:
  34. - **frame_changed** **(** **)**
  35. Emitted when the :ref:`frame<class_Sprite3D_property_frame>` changes.
  36. Property Descriptions
  37. ---------------------
  38. .. _class_Sprite3D_property_frame:
  39. - :ref:`int<class_int>` **frame**
  40. +-----------+------------------+
  41. | *Default* | ``0`` |
  42. +-----------+------------------+
  43. | *Setter* | set_frame(value) |
  44. +-----------+------------------+
  45. | *Getter* | get_frame() |
  46. +-----------+------------------+
  47. Current frame to display from sprite sheet. :ref:`vframes<class_Sprite3D_property_vframes>` or :ref:`hframes<class_Sprite3D_property_hframes>` must be greater than 1.
  48. ----
  49. .. _class_Sprite3D_property_frame_coords:
  50. - :ref:`Vector2<class_Vector2>` **frame_coords**
  51. +-----------+-------------------------+
  52. | *Default* | ``Vector2( 0, 0 )`` |
  53. +-----------+-------------------------+
  54. | *Setter* | set_frame_coords(value) |
  55. +-----------+-------------------------+
  56. | *Getter* | get_frame_coords() |
  57. +-----------+-------------------------+
  58. Coordinates of the frame to display from sprite sheet. This is as an alias for the :ref:`frame<class_Sprite3D_property_frame>` property. :ref:`vframes<class_Sprite3D_property_vframes>` or :ref:`hframes<class_Sprite3D_property_hframes>` must be greater than 1.
  59. ----
  60. .. _class_Sprite3D_property_hframes:
  61. - :ref:`int<class_int>` **hframes**
  62. +-----------+--------------------+
  63. | *Default* | ``1`` |
  64. +-----------+--------------------+
  65. | *Setter* | set_hframes(value) |
  66. +-----------+--------------------+
  67. | *Getter* | get_hframes() |
  68. +-----------+--------------------+
  69. The number of columns in the sprite sheet.
  70. ----
  71. .. _class_Sprite3D_property_region_enabled:
  72. - :ref:`bool<class_bool>` **region_enabled**
  73. +-----------+-------------------+
  74. | *Default* | ``false`` |
  75. +-----------+-------------------+
  76. | *Setter* | set_region(value) |
  77. +-----------+-------------------+
  78. | *Getter* | is_region() |
  79. +-----------+-------------------+
  80. If ``true``, texture will be cut from a larger atlas texture. See :ref:`region_rect<class_Sprite3D_property_region_rect>`.
  81. ----
  82. .. _class_Sprite3D_property_region_rect:
  83. - :ref:`Rect2<class_Rect2>` **region_rect**
  84. +-----------+-------------------------+
  85. | *Default* | ``Rect2( 0, 0, 0, 0 )`` |
  86. +-----------+-------------------------+
  87. | *Setter* | set_region_rect(value) |
  88. +-----------+-------------------------+
  89. | *Getter* | get_region_rect() |
  90. +-----------+-------------------------+
  91. The region of the atlas texture to display. :ref:`region_enabled<class_Sprite3D_property_region_enabled>` must be ``true``.
  92. ----
  93. .. _class_Sprite3D_property_texture:
  94. - :ref:`Texture2D<class_Texture2D>` **texture**
  95. +----------+--------------------+
  96. | *Setter* | set_texture(value) |
  97. +----------+--------------------+
  98. | *Getter* | get_texture() |
  99. +----------+--------------------+
  100. :ref:`Texture2D<class_Texture2D>` object to draw.
  101. ----
  102. .. _class_Sprite3D_property_vframes:
  103. - :ref:`int<class_int>` **vframes**
  104. +-----------+--------------------+
  105. | *Default* | ``1`` |
  106. +-----------+--------------------+
  107. | *Setter* | set_vframes(value) |
  108. +-----------+--------------------+
  109. | *Getter* | get_vframes() |
  110. +-----------+--------------------+
  111. The number of rows in the sprite sheet.