class_animatedsprite3d.rst 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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 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:`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. Properties
  14. ----------
  15. +-----------------------------------------+-------------------------------------------------------------+----------------+
  16. | :ref:`StringName<class_StringName>` | :ref:`animation<class_AnimatedSprite3D_property_animation>` | ``@"default"`` |
  17. +-----------------------------------------+-------------------------------------------------------------+----------------+
  18. | :ref:`int<class_int>` | :ref:`frame<class_AnimatedSprite3D_property_frame>` | ``0`` |
  19. +-----------------------------------------+-------------------------------------------------------------+----------------+
  20. | :ref:`SpriteFrames<class_SpriteFrames>` | :ref:`frames<class_AnimatedSprite3D_property_frames>` | |
  21. +-----------------------------------------+-------------------------------------------------------------+----------------+
  22. | :ref:`bool<class_bool>` | :ref:`playing<class_AnimatedSprite3D_property_playing>` | ``false`` |
  23. +-----------------------------------------+-------------------------------------------------------------+----------------+
  24. Methods
  25. -------
  26. +-------------------------+----------------------------------------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimatedSprite3D_method_is_playing>` **(** **)** const |
  28. +-------------------------+----------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`play<class_AnimatedSprite3D_method_play>` **(** :ref:`StringName<class_StringName>` anim=@"" **)** |
  30. +-------------------------+----------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`stop<class_AnimatedSprite3D_method_stop>` **(** **)** |
  32. +-------------------------+----------------------------------------------------------------------------------------------------------+
  33. Signals
  34. -------
  35. .. _class_AnimatedSprite3D_signal_frame_changed:
  36. - **frame_changed** **(** **)**
  37. Emitted when :ref:`frame<class_AnimatedSprite3D_property_frame>` changed.
  38. Property Descriptions
  39. ---------------------
  40. .. _class_AnimatedSprite3D_property_animation:
  41. - :ref:`StringName<class_StringName>` **animation**
  42. +-----------+----------------------+
  43. | *Default* | ``@"default"`` |
  44. +-----------+----------------------+
  45. | *Setter* | set_animation(value) |
  46. +-----------+----------------------+
  47. | *Getter* | get_animation() |
  48. +-----------+----------------------+
  49. The current animation from the ``frames`` resource. If this value changes, the ``frame`` counter is reset.
  50. ----
  51. .. _class_AnimatedSprite3D_property_frame:
  52. - :ref:`int<class_int>` **frame**
  53. +-----------+------------------+
  54. | *Default* | ``0`` |
  55. +-----------+------------------+
  56. | *Setter* | set_frame(value) |
  57. +-----------+------------------+
  58. | *Getter* | get_frame() |
  59. +-----------+------------------+
  60. The displayed animation frame's index.
  61. ----
  62. .. _class_AnimatedSprite3D_property_frames:
  63. - :ref:`SpriteFrames<class_SpriteFrames>` **frames**
  64. +----------+--------------------------+
  65. | *Setter* | set_sprite_frames(value) |
  66. +----------+--------------------------+
  67. | *Getter* | get_sprite_frames() |
  68. +----------+--------------------------+
  69. The :ref:`SpriteFrames<class_SpriteFrames>` resource containing the animation(s).
  70. ----
  71. .. _class_AnimatedSprite3D_property_playing:
  72. - :ref:`bool<class_bool>` **playing**
  73. +-----------+-----------+
  74. | *Default* | ``false`` |
  75. +-----------+-----------+
  76. If ``true``, the :ref:`animation<class_AnimatedSprite3D_property_animation>` is currently playing.
  77. Method Descriptions
  78. -------------------
  79. .. _class_AnimatedSprite3D_method_is_playing:
  80. - :ref:`bool<class_bool>` **is_playing** **(** **)** const
  81. Returns ``true`` if an animation is currently being played.
  82. ----
  83. .. _class_AnimatedSprite3D_method_play:
  84. - void **play** **(** :ref:`StringName<class_StringName>` anim=@"" **)**
  85. Plays the animation named ``anim``. If no ``anim`` is provided, the current animation is played.
  86. ----
  87. .. _class_AnimatedSprite3D_method_stop:
  88. - void **stop** **(** **)**
  89. Stops the current animation (does not reset the frame counter).