class_animatedsprite3d.rst 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimatedSprite3D.xml.
  6. .. _class_AnimatedSprite3D:
  7. AnimatedSprite3D
  8. ================
  9. **Inherits:** :ref:`SpriteBase3D<class_SpriteBase3D>` **<** :ref:`GeometryInstance3D<class_GeometryInstance3D>` **<** :ref:`VisualInstance3D<class_VisualInstance3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. 2D sprite node in 3D world, that can use multiple 2D textures for animation.
  11. Description
  12. -----------
  13. Animations are created using a :ref:`SpriteFrames<class_SpriteFrames>` resource, which can be configured in the editor via the SpriteFrames panel.
  14. Tutorials
  15. ---------
  16. - :doc:`2D Sprite animation (also applies to 3D) <../tutorials/2d/2d_sprite_animation>`
  17. Properties
  18. ----------
  19. +-----------------------------------------+-------------------------------------------------------------+----------------+
  20. | :ref:`StringName<class_StringName>` | :ref:`animation<class_AnimatedSprite3D_property_animation>` | ``&"default"`` |
  21. +-----------------------------------------+-------------------------------------------------------------+----------------+
  22. | :ref:`int<class_int>` | :ref:`frame<class_AnimatedSprite3D_property_frame>` | ``0`` |
  23. +-----------------------------------------+-------------------------------------------------------------+----------------+
  24. | :ref:`SpriteFrames<class_SpriteFrames>` | :ref:`frames<class_AnimatedSprite3D_property_frames>` | |
  25. +-----------------------------------------+-------------------------------------------------------------+----------------+
  26. | :ref:`bool<class_bool>` | :ref:`playing<class_AnimatedSprite3D_property_playing>` | ``false`` |
  27. +-----------------------------------------+-------------------------------------------------------------+----------------+
  28. Methods
  29. -------
  30. +------+----------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`play<class_AnimatedSprite3D_method_play>` **(** :ref:`StringName<class_StringName>` anim=&"" **)** |
  32. +------+----------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`stop<class_AnimatedSprite3D_method_stop>` **(** **)** |
  34. +------+----------------------------------------------------------------------------------------------------------+
  35. Signals
  36. -------
  37. .. _class_AnimatedSprite3D_signal_animation_finished:
  38. - **animation_finished** **(** **)**
  39. 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.
  40. ----
  41. .. _class_AnimatedSprite3D_signal_frame_changed:
  42. - **frame_changed** **(** **)**
  43. Emitted when :ref:`frame<class_AnimatedSprite3D_property_frame>` changed.
  44. Property Descriptions
  45. ---------------------
  46. .. _class_AnimatedSprite3D_property_animation:
  47. - :ref:`StringName<class_StringName>` **animation**
  48. +-----------+----------------------+
  49. | *Default* | ``&"default"`` |
  50. +-----------+----------------------+
  51. | *Setter* | set_animation(value) |
  52. +-----------+----------------------+
  53. | *Getter* | get_animation() |
  54. +-----------+----------------------+
  55. The current animation from the ``frames`` resource. If this value changes, the ``frame`` counter is reset.
  56. ----
  57. .. _class_AnimatedSprite3D_property_frame:
  58. - :ref:`int<class_int>` **frame**
  59. +-----------+------------------+
  60. | *Default* | ``0`` |
  61. +-----------+------------------+
  62. | *Setter* | set_frame(value) |
  63. +-----------+------------------+
  64. | *Getter* | get_frame() |
  65. +-----------+------------------+
  66. The displayed animation frame's index.
  67. ----
  68. .. _class_AnimatedSprite3D_property_frames:
  69. - :ref:`SpriteFrames<class_SpriteFrames>` **frames**
  70. +----------+--------------------------+
  71. | *Setter* | set_sprite_frames(value) |
  72. +----------+--------------------------+
  73. | *Getter* | get_sprite_frames() |
  74. +----------+--------------------------+
  75. The :ref:`SpriteFrames<class_SpriteFrames>` resource containing the animation(s).
  76. ----
  77. .. _class_AnimatedSprite3D_property_playing:
  78. - :ref:`bool<class_bool>` **playing**
  79. +-----------+--------------------+
  80. | *Default* | ``false`` |
  81. +-----------+--------------------+
  82. | *Setter* | set_playing(value) |
  83. +-----------+--------------------+
  84. | *Getter* | is_playing() |
  85. +-----------+--------------------+
  86. If ``true``, the :ref:`animation<class_AnimatedSprite3D_property_animation>` is currently playing.
  87. Method Descriptions
  88. -------------------
  89. .. _class_AnimatedSprite3D_method_play:
  90. - void **play** **(** :ref:`StringName<class_StringName>` anim=&"" **)**
  91. Plays the animation named ``anim``. If no ``anim`` is provided, the current animation is played.
  92. ----
  93. .. _class_AnimatedSprite3D_method_stop:
  94. - void **stop** **(** **)**
  95. Stops the current animation (does not reset the frame counter).
  96. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  97. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  98. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  99. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  100. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  101. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`