class_sprite3d.rst 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Sprite3D.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Sprite3D:
  5. Sprite3D
  6. ========
  7. **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>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. 2D sprite node in a 3D world.
  12. Properties
  13. ----------
  14. +-------------------------------+---------------------------------------------------------------+---------------------+
  15. | :ref:`int<class_int>` | :ref:`frame<class_Sprite3D_property_frame>` | 0 |
  16. +-------------------------------+---------------------------------------------------------------+---------------------+
  17. | :ref:`int<class_int>` | :ref:`hframes<class_Sprite3D_property_hframes>` | 1 |
  18. +-------------------------------+---------------------------------------------------------------+---------------------+
  19. | :ref:`bool<class_bool>` | :ref:`region_enabled<class_Sprite3D_property_region_enabled>` | false |
  20. +-------------------------------+---------------------------------------------------------------+---------------------+
  21. | :ref:`Rect2<class_Rect2>` | :ref:`region_rect<class_Sprite3D_property_region_rect>` | Rect2( 0, 0, 0, 0 ) |
  22. +-------------------------------+---------------------------------------------------------------+---------------------+
  23. | :ref:`Texture<class_Texture>` | :ref:`texture<class_Sprite3D_property_texture>` | |
  24. +-------------------------------+---------------------------------------------------------------+---------------------+
  25. | :ref:`int<class_int>` | :ref:`vframes<class_Sprite3D_property_vframes>` | 1 |
  26. +-------------------------------+---------------------------------------------------------------+---------------------+
  27. Signals
  28. -------
  29. .. _class_Sprite3D_signal_frame_changed:
  30. - **frame_changed** **(** **)**
  31. Emitted when the :ref:`frame<class_Sprite3D_property_frame>` changes.
  32. Description
  33. -----------
  34. 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.
  35. Property Descriptions
  36. ---------------------
  37. .. _class_Sprite3D_property_frame:
  38. - :ref:`int<class_int>` **frame**
  39. +-----------+------------------+
  40. | *Default* | 0 |
  41. +-----------+------------------+
  42. | *Setter* | set_frame(value) |
  43. +-----------+------------------+
  44. | *Getter* | get_frame() |
  45. +-----------+------------------+
  46. 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.
  47. .. _class_Sprite3D_property_hframes:
  48. - :ref:`int<class_int>` **hframes**
  49. +-----------+--------------------+
  50. | *Default* | 1 |
  51. +-----------+--------------------+
  52. | *Setter* | set_hframes(value) |
  53. +-----------+--------------------+
  54. | *Getter* | get_hframes() |
  55. +-----------+--------------------+
  56. The number of columns in the sprite sheet.
  57. .. _class_Sprite3D_property_region_enabled:
  58. - :ref:`bool<class_bool>` **region_enabled**
  59. +-----------+-------------------+
  60. | *Default* | false |
  61. +-----------+-------------------+
  62. | *Setter* | set_region(value) |
  63. +-----------+-------------------+
  64. | *Getter* | is_region() |
  65. +-----------+-------------------+
  66. If ``true``, texture will be cut from a larger atlas texture. See :ref:`region_rect<class_Sprite3D_property_region_rect>`.
  67. .. _class_Sprite3D_property_region_rect:
  68. - :ref:`Rect2<class_Rect2>` **region_rect**
  69. +-----------+------------------------+
  70. | *Default* | Rect2( 0, 0, 0, 0 ) |
  71. +-----------+------------------------+
  72. | *Setter* | set_region_rect(value) |
  73. +-----------+------------------------+
  74. | *Getter* | get_region_rect() |
  75. +-----------+------------------------+
  76. The region of the atlas texture to display. :ref:`region_enabled<class_Sprite3D_property_region_enabled>` must be ``true``.
  77. .. _class_Sprite3D_property_texture:
  78. - :ref:`Texture<class_Texture>` **texture**
  79. +----------+--------------------+
  80. | *Setter* | set_texture(value) |
  81. +----------+--------------------+
  82. | *Getter* | get_texture() |
  83. +----------+--------------------+
  84. :ref:`Texture<class_Texture>` object to draw.
  85. .. _class_Sprite3D_property_vframes:
  86. - :ref:`int<class_int>` **vframes**
  87. +-----------+--------------------+
  88. | *Default* | 1 |
  89. +-----------+--------------------+
  90. | *Setter* | set_vframes(value) |
  91. +-----------+--------------------+
  92. | *Getter* | get_vframes() |
  93. +-----------+--------------------+
  94. The number of rows in the sprite sheet.