class_animatedsprite3d.rst 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/AnimatedSprite3D.xml.
  6. .. _class_AnimatedSprite3D:
  7. AnimatedSprite3D
  8. ================
  9. **Inherits:** :ref:`SpriteBase3D<class_SpriteBase3D>` **<** :ref:`GeometryInstance<class_GeometryInstance>` **<** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. 2D sprite node in 3D world, that can use multiple 2D textures for animation.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Animations are created using a :ref:`SpriteFrames<class_SpriteFrames>` resource, which can be configured in the editor via the SpriteFrames panel.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`2D Sprite animation (also applies to 3D) <../tutorials/2d/2d_sprite_animation>`
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +-----------------------------------------+-------------------------------------------------------------+---------------+
  25. | :ref:`String<class_String>` | :ref:`animation<class_AnimatedSprite3D_property_animation>` | ``"default"`` |
  26. +-----------------------------------------+-------------------------------------------------------------+---------------+
  27. | :ref:`int<class_int>` | :ref:`frame<class_AnimatedSprite3D_property_frame>` | ``0`` |
  28. +-----------------------------------------+-------------------------------------------------------------+---------------+
  29. | :ref:`SpriteFrames<class_SpriteFrames>` | :ref:`frames<class_AnimatedSprite3D_property_frames>` | |
  30. +-----------------------------------------+-------------------------------------------------------------+---------------+
  31. | :ref:`bool<class_bool>` | :ref:`playing<class_AnimatedSprite3D_property_playing>` | ``false`` |
  32. +-----------------------------------------+-------------------------------------------------------------+---------------+
  33. .. rst-class:: classref-reftable-group
  34. Methods
  35. -------
  36. .. table::
  37. :widths: auto
  38. +-------------------------+-------------------------------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimatedSprite3D_method_is_playing>` **(** **)** |const| |
  40. +-------------------------+-------------------------------------------------------------------------------------------------+
  41. | void | :ref:`play<class_AnimatedSprite3D_method_play>` **(** :ref:`String<class_String>` anim="" **)** |
  42. +-------------------------+-------------------------------------------------------------------------------------------------+
  43. | void | :ref:`stop<class_AnimatedSprite3D_method_stop>` **(** **)** |
  44. +-------------------------+-------------------------------------------------------------------------------------------------+
  45. .. rst-class:: classref-section-separator
  46. ----
  47. .. rst-class:: classref-descriptions-group
  48. Signals
  49. -------
  50. .. _class_AnimatedSprite3D_signal_animation_finished:
  51. .. rst-class:: classref-signal
  52. **animation_finished** **(** **)**
  53. Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn.
  54. .. rst-class:: classref-item-separator
  55. ----
  56. .. _class_AnimatedSprite3D_signal_frame_changed:
  57. .. rst-class:: classref-signal
  58. **frame_changed** **(** **)**
  59. Emitted when :ref:`frame<class_AnimatedSprite3D_property_frame>` changed.
  60. .. rst-class:: classref-section-separator
  61. ----
  62. .. rst-class:: classref-descriptions-group
  63. Property Descriptions
  64. ---------------------
  65. .. _class_AnimatedSprite3D_property_animation:
  66. .. rst-class:: classref-property
  67. :ref:`String<class_String>` **animation** = ``"default"``
  68. .. rst-class:: classref-property-setget
  69. - void **set_animation** **(** :ref:`String<class_String>` value **)**
  70. - :ref:`String<class_String>` **get_animation** **(** **)**
  71. The current animation from the ``frames`` resource. If this value changes, the ``frame`` counter is reset.
  72. .. rst-class:: classref-item-separator
  73. ----
  74. .. _class_AnimatedSprite3D_property_frame:
  75. .. rst-class:: classref-property
  76. :ref:`int<class_int>` **frame** = ``0``
  77. .. rst-class:: classref-property-setget
  78. - void **set_frame** **(** :ref:`int<class_int>` value **)**
  79. - :ref:`int<class_int>` **get_frame** **(** **)**
  80. The displayed animation frame's index.
  81. .. rst-class:: classref-item-separator
  82. ----
  83. .. _class_AnimatedSprite3D_property_frames:
  84. .. rst-class:: classref-property
  85. :ref:`SpriteFrames<class_SpriteFrames>` **frames**
  86. .. rst-class:: classref-property-setget
  87. - void **set_sprite_frames** **(** :ref:`SpriteFrames<class_SpriteFrames>` value **)**
  88. - :ref:`SpriteFrames<class_SpriteFrames>` **get_sprite_frames** **(** **)**
  89. The :ref:`SpriteFrames<class_SpriteFrames>` resource containing the animation(s).
  90. .. rst-class:: classref-item-separator
  91. ----
  92. .. _class_AnimatedSprite3D_property_playing:
  93. .. rst-class:: classref-property
  94. :ref:`bool<class_bool>` **playing** = ``false``
  95. If ``true``, the :ref:`animation<class_AnimatedSprite3D_property_animation>` is currently playing.
  96. .. rst-class:: classref-section-separator
  97. ----
  98. .. rst-class:: classref-descriptions-group
  99. Method Descriptions
  100. -------------------
  101. .. _class_AnimatedSprite3D_method_is_playing:
  102. .. rst-class:: classref-method
  103. :ref:`bool<class_bool>` **is_playing** **(** **)** |const|
  104. Returns ``true`` if an animation is currently being played.
  105. .. rst-class:: classref-item-separator
  106. ----
  107. .. _class_AnimatedSprite3D_method_play:
  108. .. rst-class:: classref-method
  109. void **play** **(** :ref:`String<class_String>` anim="" **)**
  110. Plays the animation named ``anim``. If no ``anim`` is provided, the current animation is played.
  111. .. rst-class:: classref-item-separator
  112. ----
  113. .. _class_AnimatedSprite3D_method_stop:
  114. .. rst-class:: classref-method
  115. void **stop** **(** **)**
  116. Stops the current animation (does not reset the frame counter).
  117. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  118. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  119. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  120. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`