mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
109 lines
3.6 KiB
ReStructuredText
109 lines
3.6 KiB
ReStructuredText
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the AnimatedSprite.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_AnimatedSprite:
|
|
|
|
AnimatedSprite
|
|
==============
|
|
|
|
**Inherits:** :ref:`Node2D<class_node2d>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
|
|
|
|
**Category:** Core
|
|
|
|
Brief Description
|
|
-----------------
|
|
|
|
Sprite node that can use multiple textures for animation.
|
|
|
|
Member Functions
|
|
----------------
|
|
|
|
+--------------------------+----------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimatedSprite_is_playing>` **(** **)** const |
|
|
+--------------------------+----------------------------------------------------------------------------------------+
|
|
| void | :ref:`play<class_AnimatedSprite_play>` **(** :ref:`String<class_string>` anim="" **)** |
|
|
+--------------------------+----------------------------------------------------------------------------------------+
|
|
| void | :ref:`stop<class_AnimatedSprite_stop>` **(** **)** |
|
|
+--------------------------+----------------------------------------------------------------------------------------+
|
|
|
|
Signals
|
|
-------
|
|
|
|
.. _class_AnimatedSprite_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_AnimatedSprite_frame_changed:
|
|
|
|
- **frame_changed** **(** **)**
|
|
|
|
Emitted when :ref:`frame<class_AnimatedSprite_frame>` changed.
|
|
|
|
|
|
Member Variables
|
|
----------------
|
|
|
|
.. _class_AnimatedSprite_animation:
|
|
|
|
- :ref:`String<class_string>` **animation** - The current animation from the ``frames`` resource. If this value changes, the ``frame`` counter is reset.
|
|
|
|
.. _class_AnimatedSprite_centered:
|
|
|
|
- :ref:`bool<class_bool>` **centered** - If ``true`` texture will be centered. Default value: ``true``.
|
|
|
|
.. _class_AnimatedSprite_flip_h:
|
|
|
|
- :ref:`bool<class_bool>` **flip_h** - If ``true`` texture is flipped horizontally. Default value: ``false``.
|
|
|
|
.. _class_AnimatedSprite_flip_v:
|
|
|
|
- :ref:`bool<class_bool>` **flip_v** - If ``true`` texture is flipped vertically. Default value: ``false``.
|
|
|
|
.. _class_AnimatedSprite_frame:
|
|
|
|
- :ref:`int<class_int>` **frame** - The displayed animation frame's index.
|
|
|
|
.. _class_AnimatedSprite_frames:
|
|
|
|
- :ref:`SpriteFrames<class_spriteframes>` **frames** - The :ref:`SpriteFrames<class_spriteframes>` resource containing the animation(s).
|
|
|
|
.. _class_AnimatedSprite_offset:
|
|
|
|
- :ref:`Vector2<class_vector2>` **offset** - The texture's drawing offset.
|
|
|
|
.. _class_AnimatedSprite_playing:
|
|
|
|
- :ref:`bool<class_bool>` **playing** - If ``true`` the :ref:`animation<class_AnimatedSprite_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_AnimatedSprite_is_playing:
|
|
|
|
- :ref:`bool<class_bool>` **is_playing** **(** **)** const
|
|
|
|
Return true if an animation if currently being played.
|
|
|
|
.. _class_AnimatedSprite_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_AnimatedSprite_stop:
|
|
|
|
- void **stop** **(** **)**
|
|
|
|
Stop the current animation (does not reset the frame counter).
|
|
|
|
|