:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/AnimatedSprite3D.xml. .. _class_AnimatedSprite3D: AnimatedSprite3D ================ **Inherits:** :ref:`SpriteBase3D` **<** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` 2D sprite node in 3D world, that can use multiple 2D textures for animation. .. rst-class:: classref-introduction-group Description ----------- Animations are created using a :ref:`SpriteFrames` resource, which can be configured in the editor via the SpriteFrames panel. .. rst-class:: classref-introduction-group Tutorials --------- - :doc:`2D Sprite animation (also applies to 3D) <../tutorials/2d/2d_sprite_animation>` .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-----------------------------------------+-------------------------------------------------------------+---------------+ | :ref:`String` | :ref:`animation` | ``"default"`` | +-----------------------------------------+-------------------------------------------------------------+---------------+ | :ref:`int` | :ref:`frame` | ``0`` | +-----------------------------------------+-------------------------------------------------------------+---------------+ | :ref:`SpriteFrames` | :ref:`frames` | | +-----------------------------------------+-------------------------------------------------------------+---------------+ | :ref:`bool` | :ref:`playing` | ``false`` | +-----------------------------------------+-------------------------------------------------------------+---------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------+-------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_playing` **(** **)** |const| | +-------------------------+-------------------------------------------------------------------------------------------------+ | void | :ref:`play` **(** :ref:`String` anim="" **)** | +-------------------------+-------------------------------------------------------------------------------------------------+ | void | :ref:`stop` **(** **)** | +-------------------------+-------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_AnimatedSprite3D_signal_animation_finished: .. rst-class:: classref-signal **animation_finished** **(** **)** 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. .. rst-class:: classref-item-separator ---- .. _class_AnimatedSprite3D_signal_frame_changed: .. rst-class:: classref-signal **frame_changed** **(** **)** Emitted when :ref:`frame` changed. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_AnimatedSprite3D_property_animation: .. rst-class:: classref-property :ref:`String` **animation** = ``"default"`` .. rst-class:: classref-property-setget - void **set_animation** **(** :ref:`String` value **)** - :ref:`String` **get_animation** **(** **)** The current animation from the ``frames`` resource. If this value changes, the ``frame`` counter is reset. .. rst-class:: classref-item-separator ---- .. _class_AnimatedSprite3D_property_frame: .. rst-class:: classref-property :ref:`int` **frame** = ``0`` .. rst-class:: classref-property-setget - void **set_frame** **(** :ref:`int` value **)** - :ref:`int` **get_frame** **(** **)** The displayed animation frame's index. .. rst-class:: classref-item-separator ---- .. _class_AnimatedSprite3D_property_frames: .. rst-class:: classref-property :ref:`SpriteFrames` **frames** .. rst-class:: classref-property-setget - void **set_sprite_frames** **(** :ref:`SpriteFrames` value **)** - :ref:`SpriteFrames` **get_sprite_frames** **(** **)** The :ref:`SpriteFrames` resource containing the animation(s). .. rst-class:: classref-item-separator ---- .. _class_AnimatedSprite3D_property_playing: .. rst-class:: classref-property :ref:`bool` **playing** = ``false`` If ``true``, the :ref:`animation` is currently playing. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_AnimatedSprite3D_method_is_playing: .. rst-class:: classref-method :ref:`bool` **is_playing** **(** **)** |const| Returns ``true`` if an animation is currently being played. .. rst-class:: classref-item-separator ---- .. _class_AnimatedSprite3D_method_play: .. rst-class:: classref-method void **play** **(** :ref:`String` anim="" **)** Plays the animation named ``anim``. If no ``anim`` is provided, the current animation is played. .. rst-class:: classref-item-separator ---- .. _class_AnimatedSprite3D_method_stop: .. rst-class:: classref-method void **stop** **(** **)** Stops the current animation (does not reset the frame counter). .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`