class_animatedsprite3d.rst 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the AnimatedSprite3D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_AnimatedSprite3D:
  6. AnimatedSprite3D
  7. ================
  8. **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>`
  9. 2D sprite node in 3D world, that can use multiple 2D textures for animation.
  10. Description
  11. -----------
  12. Animations are created using a :ref:`SpriteFrames<class_SpriteFrames>` resource, which can be configured in the editor via the SpriteFrames panel.
  13. Tutorials
  14. ---------
  15. - :doc:`../tutorials/2d/2d_sprite_animation`
  16. Properties
  17. ----------
  18. +-----------------------------------------+-------------------------------------------------------------+---------------+
  19. | :ref:`String<class_String>` | :ref:`animation<class_AnimatedSprite3D_property_animation>` | ``"default"`` |
  20. +-----------------------------------------+-------------------------------------------------------------+---------------+
  21. | :ref:`int<class_int>` | :ref:`frame<class_AnimatedSprite3D_property_frame>` | ``0`` |
  22. +-----------------------------------------+-------------------------------------------------------------+---------------+
  23. | :ref:`SpriteFrames<class_SpriteFrames>` | :ref:`frames<class_AnimatedSprite3D_property_frames>` | |
  24. +-----------------------------------------+-------------------------------------------------------------+---------------+
  25. | :ref:`bool<class_bool>` | :ref:`playing<class_AnimatedSprite3D_property_playing>` | ``false`` |
  26. +-----------------------------------------+-------------------------------------------------------------+---------------+
  27. Methods
  28. -------
  29. +-------------------------+-------------------------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimatedSprite3D_method_is_playing>` **(** **)** |const| |
  31. +-------------------------+-------------------------------------------------------------------------------------------------+
  32. | void | :ref:`play<class_AnimatedSprite3D_method_play>` **(** :ref:`String<class_String>` anim="" **)** |
  33. +-------------------------+-------------------------------------------------------------------------------------------------+
  34. | void | :ref:`stop<class_AnimatedSprite3D_method_stop>` **(** **)** |
  35. +-------------------------+-------------------------------------------------------------------------------------------------+
  36. Signals
  37. -------
  38. .. _class_AnimatedSprite3D_signal_animation_finished:
  39. - **animation_finished** **(** **)**
  40. 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.
  41. ----
  42. .. _class_AnimatedSprite3D_signal_frame_changed:
  43. - **frame_changed** **(** **)**
  44. Emitted when :ref:`frame<class_AnimatedSprite3D_property_frame>` changed.
  45. Property Descriptions
  46. ---------------------
  47. .. _class_AnimatedSprite3D_property_animation:
  48. - :ref:`String<class_String>` **animation**
  49. +-----------+----------------------+
  50. | *Default* | ``"default"`` |
  51. +-----------+----------------------+
  52. | *Setter* | set_animation(value) |
  53. +-----------+----------------------+
  54. | *Getter* | get_animation() |
  55. +-----------+----------------------+
  56. The current animation from the ``frames`` resource. If this value changes, the ``frame`` counter is reset.
  57. ----
  58. .. _class_AnimatedSprite3D_property_frame:
  59. - :ref:`int<class_int>` **frame**
  60. +-----------+------------------+
  61. | *Default* | ``0`` |
  62. +-----------+------------------+
  63. | *Setter* | set_frame(value) |
  64. +-----------+------------------+
  65. | *Getter* | get_frame() |
  66. +-----------+------------------+
  67. The displayed animation frame's index.
  68. ----
  69. .. _class_AnimatedSprite3D_property_frames:
  70. - :ref:`SpriteFrames<class_SpriteFrames>` **frames**
  71. +----------+--------------------------+
  72. | *Setter* | set_sprite_frames(value) |
  73. +----------+--------------------------+
  74. | *Getter* | get_sprite_frames() |
  75. +----------+--------------------------+
  76. The :ref:`SpriteFrames<class_SpriteFrames>` resource containing the animation(s).
  77. ----
  78. .. _class_AnimatedSprite3D_property_playing:
  79. - :ref:`bool<class_bool>` **playing**
  80. +-----------+-----------+
  81. | *Default* | ``false`` |
  82. +-----------+-----------+
  83. If ``true``, the :ref:`animation<class_AnimatedSprite3D_property_animation>` is currently playing.
  84. Method Descriptions
  85. -------------------
  86. .. _class_AnimatedSprite3D_method_is_playing:
  87. - :ref:`bool<class_bool>` **is_playing** **(** **)** |const|
  88. Returns ``true`` if an animation is currently being played.
  89. ----
  90. .. _class_AnimatedSprite3D_method_play:
  91. - void **play** **(** :ref:`String<class_String>` anim="" **)**
  92. Plays the animation named ``anim``. If no ``anim`` is provided, the current animation is played.
  93. ----
  94. .. _class_AnimatedSprite3D_method_stop:
  95. - void **stop** **(** **)**
  96. Stops the current animation (does not reset the frame counter).
  97. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  98. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  99. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`