class_sprite3d.rst 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. **Category:** Core
  10. Brief Description
  11. -----------------
  12. 2D sprite node in a 3D world.
  13. Properties
  14. ----------
  15. +-------------------------------+---------------------------------------------------------------+---------------------+
  16. | :ref:`int<class_int>` | :ref:`frame<class_Sprite3D_property_frame>` | 0 |
  17. +-------------------------------+---------------------------------------------------------------+---------------------+
  18. | :ref:`int<class_int>` | :ref:`hframes<class_Sprite3D_property_hframes>` | 1 |
  19. +-------------------------------+---------------------------------------------------------------+---------------------+
  20. | :ref:`bool<class_bool>` | :ref:`region_enabled<class_Sprite3D_property_region_enabled>` | false |
  21. +-------------------------------+---------------------------------------------------------------+---------------------+
  22. | :ref:`Rect2<class_Rect2>` | :ref:`region_rect<class_Sprite3D_property_region_rect>` | Rect2( 0, 0, 0, 0 ) |
  23. +-------------------------------+---------------------------------------------------------------+---------------------+
  24. | :ref:`Texture<class_Texture>` | :ref:`texture<class_Sprite3D_property_texture>` | |
  25. +-------------------------------+---------------------------------------------------------------+---------------------+
  26. | :ref:`int<class_int>` | :ref:`vframes<class_Sprite3D_property_vframes>` | 1 |
  27. +-------------------------------+---------------------------------------------------------------+---------------------+
  28. Signals
  29. -------
  30. .. _class_Sprite3D_signal_frame_changed:
  31. - **frame_changed** **(** **)**
  32. Emitted when the :ref:`frame<class_Sprite3D_property_frame>` changes.
  33. Description
  34. -----------
  35. 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.
  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. .. _class_Sprite3D_property_hframes:
  49. - :ref:`int<class_int>` **hframes**
  50. +-----------+--------------------+
  51. | *Default* | 1 |
  52. +-----------+--------------------+
  53. | *Setter* | set_hframes(value) |
  54. +-----------+--------------------+
  55. | *Getter* | get_hframes() |
  56. +-----------+--------------------+
  57. The number of columns in the sprite sheet.
  58. .. _class_Sprite3D_property_region_enabled:
  59. - :ref:`bool<class_bool>` **region_enabled**
  60. +-----------+-------------------+
  61. | *Default* | false |
  62. +-----------+-------------------+
  63. | *Setter* | set_region(value) |
  64. +-----------+-------------------+
  65. | *Getter* | is_region() |
  66. +-----------+-------------------+
  67. If ``true``, texture will be cut from a larger atlas texture. See :ref:`region_rect<class_Sprite3D_property_region_rect>`.
  68. .. _class_Sprite3D_property_region_rect:
  69. - :ref:`Rect2<class_Rect2>` **region_rect**
  70. +-----------+------------------------+
  71. | *Default* | Rect2( 0, 0, 0, 0 ) |
  72. +-----------+------------------------+
  73. | *Setter* | set_region_rect(value) |
  74. +-----------+------------------------+
  75. | *Getter* | get_region_rect() |
  76. +-----------+------------------------+
  77. The region of the atlas texture to display. :ref:`region_enabled<class_Sprite3D_property_region_enabled>` must be ``true``.
  78. .. _class_Sprite3D_property_texture:
  79. - :ref:`Texture<class_Texture>` **texture**
  80. +----------+--------------------+
  81. | *Setter* | set_texture(value) |
  82. +----------+--------------------+
  83. | *Getter* | get_texture() |
  84. +----------+--------------------+
  85. :ref:`Texture<class_Texture>` object to draw.
  86. .. _class_Sprite3D_property_vframes:
  87. - :ref:`int<class_int>` **vframes**
  88. +-----------+--------------------+
  89. | *Default* | 1 |
  90. +-----------+--------------------+
  91. | *Setter* | set_vframes(value) |
  92. +-----------+--------------------+
  93. | *Getter* | get_vframes() |
  94. +-----------+--------------------+
  95. The number of rows in the sprite sheet.