Files
godot-docs/classes/class_animatedsprite3d.rst

121 lines
6.5 KiB
ReStructuredText

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the AnimatedSprite3D.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
.. _class_AnimatedSprite3D:
AnimatedSprite3D
================
**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>`
**Category:** Core
Brief Description
-----------------
2D sprite node in 3D world, that can use multiple 2D textures for animation.
Member Functions
----------------
+------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_string>` | :ref:`get_animation<class_AnimatedSprite3D_get_animation>` **(** **)** const |
+------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_frame<class_AnimatedSprite3D_get_frame>` **(** **)** const |
+------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`SpriteFrames<class_spriteframes>` | :ref:`get_sprite_frames<class_AnimatedSprite3D_get_sprite_frames>` **(** **)** const |
+------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimatedSprite3D_is_playing>` **(** **)** const |
+------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AnimatedSprite3D_play>` **(** :ref:`String<class_string>` anim="" **)** |
+------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_animation<class_AnimatedSprite3D_set_animation>` **(** :ref:`String<class_string>` animation **)** |
+------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_frame<class_AnimatedSprite3D_set_frame>` **(** :ref:`int<class_int>` frame **)** |
+------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_sprite_frames<class_AnimatedSprite3D_set_sprite_frames>` **(** :ref:`SpriteFrames<class_spriteframes>` sprite_frames **)** |
+------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimatedSprite3D_stop>` **(** **)** |
+------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
Signals
-------
- **frame_changed** **(** **)**
Emitted when member frame changed.
Member Variables
----------------
- :ref:`String<class_string>` **animation** - The current animation from the ``frames`` resource. If this value changes, the ``frame`` counter is reset.
- :ref:`int<class_int>` **frame** - The displayed animation frame's index.
- :ref:`SpriteFrames<class_spriteframes>` **frames** - The :ref:`SpriteFrames<class_spriteframes>` resource containing the animation(s).
- :ref:`bool<class_bool>` **playing** - If ``true`` the member animation is currently playing.
Description
-----------
Animations are created using a :ref:`SpriteFrames<class_spriteframes>` resource, which can be configured in the editor via the SpriteFrames panel.
Member Function Description
---------------------------
.. _class_AnimatedSprite3D_get_animation:
- :ref:`String<class_string>` **get_animation** **(** **)** const
Return the name of the current animation set to the node.
.. _class_AnimatedSprite3D_get_frame:
- :ref:`int<class_int>` **get_frame** **(** **)** const
Return the visible frame index.
.. _class_AnimatedSprite3D_get_sprite_frames:
- :ref:`SpriteFrames<class_spriteframes>` **get_sprite_frames** **(** **)** const
Get the :ref:`SpriteFrames<class_spriteframes>` resource, which contains all frames.
.. _class_AnimatedSprite3D_is_playing:
- :ref:`bool<class_bool>` **is_playing** **(** **)** const
Return true if an animation if currently being played.
.. _class_AnimatedSprite3D_play:
- void **play** **(** :ref:`String<class_string>` anim="" **)**
Play the animation set in parameter. If no parameter is provided, the current animation is played.
.. _class_AnimatedSprite3D_set_animation:
- void **set_animation** **(** :ref:`String<class_string>` animation **)**
Set the current animation of the node and reinits the frame counter of the animation.
.. _class_AnimatedSprite3D_set_frame:
- void **set_frame** **(** :ref:`int<class_int>` frame **)**
Set the visible sprite frame index (from the list of frames inside the :ref:`SpriteFrames<class_spriteframes>` resource).
.. _class_AnimatedSprite3D_set_sprite_frames:
- void **set_sprite_frames** **(** :ref:`SpriteFrames<class_spriteframes>` sprite_frames **)**
Set the :ref:`SpriteFrames<class_spriteframes>` resource, which contains all frames.
.. _class_AnimatedSprite3D_stop:
- void **stop** **(** **)**
Stop the current animation (does not reset the frame counter).