123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- :github_url: hide
- .. Generated automatically by doc/tools/make_rst.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:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- 2D sprite node in 3D world, that can use multiple 2D textures for animation.
- Description
- -----------
- Animations are created using a :ref:`SpriteFrames<class_SpriteFrames>` resource, which can be configured in the editor via the SpriteFrames panel.
- Tutorials
- ---------
- - :doc:`../tutorials/2d/2d_sprite_animation`
- Properties
- ----------
- +-----------------------------------------+-------------------------------------------------------------+---------------+
- | :ref:`String<class_String>` | :ref:`animation<class_AnimatedSprite3D_property_animation>` | ``"default"`` |
- +-----------------------------------------+-------------------------------------------------------------+---------------+
- | :ref:`int<class_int>` | :ref:`frame<class_AnimatedSprite3D_property_frame>` | ``0`` |
- +-----------------------------------------+-------------------------------------------------------------+---------------+
- | :ref:`SpriteFrames<class_SpriteFrames>` | :ref:`frames<class_AnimatedSprite3D_property_frames>` | |
- +-----------------------------------------+-------------------------------------------------------------+---------------+
- | :ref:`bool<class_bool>` | :ref:`playing<class_AnimatedSprite3D_property_playing>` | ``false`` |
- +-----------------------------------------+-------------------------------------------------------------+---------------+
- Methods
- -------
- +-------------------------+-------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimatedSprite3D_method_is_playing>` **(** **)** |const| |
- +-------------------------+-------------------------------------------------------------------------------------------------+
- | void | :ref:`play<class_AnimatedSprite3D_method_play>` **(** :ref:`String<class_String>` anim="" **)** |
- +-------------------------+-------------------------------------------------------------------------------------------------+
- | void | :ref:`stop<class_AnimatedSprite3D_method_stop>` **(** **)** |
- +-------------------------+-------------------------------------------------------------------------------------------------+
- Signals
- -------
- .. _class_AnimatedSprite3D_signal_animation_finished:
- - **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.
- ----
- .. _class_AnimatedSprite3D_signal_frame_changed:
- - **frame_changed** **(** **)**
- Emitted when :ref:`frame<class_AnimatedSprite3D_property_frame>` changed.
- Property Descriptions
- ---------------------
- .. _class_AnimatedSprite3D_property_animation:
- - :ref:`String<class_String>` **animation**
- +-----------+----------------------+
- | *Default* | ``"default"`` |
- +-----------+----------------------+
- | *Setter* | set_animation(value) |
- +-----------+----------------------+
- | *Getter* | get_animation() |
- +-----------+----------------------+
- The current animation from the ``frames`` resource. If this value changes, the ``frame`` counter is reset.
- ----
- .. _class_AnimatedSprite3D_property_frame:
- - :ref:`int<class_int>` **frame**
- +-----------+------------------+
- | *Default* | ``0`` |
- +-----------+------------------+
- | *Setter* | set_frame(value) |
- +-----------+------------------+
- | *Getter* | get_frame() |
- +-----------+------------------+
- The displayed animation frame's index.
- ----
- .. _class_AnimatedSprite3D_property_frames:
- - :ref:`SpriteFrames<class_SpriteFrames>` **frames**
- +----------+--------------------------+
- | *Setter* | set_sprite_frames(value) |
- +----------+--------------------------+
- | *Getter* | get_sprite_frames() |
- +----------+--------------------------+
- The :ref:`SpriteFrames<class_SpriteFrames>` resource containing the animation(s).
- ----
- .. _class_AnimatedSprite3D_property_playing:
- - :ref:`bool<class_bool>` **playing**
- +-----------+-----------+
- | *Default* | ``false`` |
- +-----------+-----------+
- If ``true``, the :ref:`animation<class_AnimatedSprite3D_property_animation>` is currently playing.
- Method Descriptions
- -------------------
- .. _class_AnimatedSprite3D_method_is_playing:
- - :ref:`bool<class_bool>` **is_playing** **(** **)** |const|
- Returns ``true`` if an animation is currently being played.
- ----
- .. _class_AnimatedSprite3D_method_play:
- - void **play** **(** :ref:`String<class_String>` anim="" **)**
- Plays the animation named ``anim``. If no ``anim`` is provided, the current animation is played.
- ----
- .. _class_AnimatedSprite3D_method_stop:
- - 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.)`
|