.. 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//doc_classes. .. _class_AnimatedSprite: AnimatedSprite ============== **Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Sprite node that can use multiple textures for animation. Member Functions ---------------- +--------------------------+----------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_playing` **(** **)** const | +--------------------------+----------------------------------------------------------------------------------------+ | void | :ref:`play` **(** :ref:`String` anim="" **)** | +--------------------------+----------------------------------------------------------------------------------------+ | void | :ref:`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` changed. Member Variables ---------------- .. _class_AnimatedSprite_animation: - :ref:`String` **animation** - The current animation from the ``frames`` resource. If this value changes, the ``frame`` counter is reset. .. _class_AnimatedSprite_centered: - :ref:`bool` **centered** - If ``true`` texture will be centered. Default value: ``true``. .. _class_AnimatedSprite_flip_h: - :ref:`bool` **flip_h** - If ``true`` texture is flipped horizontally. Default value: ``false``. .. _class_AnimatedSprite_flip_v: - :ref:`bool` **flip_v** - If ``true`` texture is flipped vertically. Default value: ``false``. .. _class_AnimatedSprite_frame: - :ref:`int` **frame** - The displayed animation frame's index. .. _class_AnimatedSprite_frames: - :ref:`SpriteFrames` **frames** - The :ref:`SpriteFrames` resource containing the animation(s). .. _class_AnimatedSprite_offset: - :ref:`Vector2` **offset** - The texture's drawing offset. .. _class_AnimatedSprite_playing: - :ref:`bool` **playing** - If ``true`` the :ref:`animation` is currently playing. Description ----------- Animations are created using a :ref:`SpriteFrames` resource, which can be configured in the editor via the SpriteFrames panel. Member Function Description --------------------------- .. _class_AnimatedSprite_is_playing: - :ref:`bool` **is_playing** **(** **)** const Return true if an animation if currently being played. .. _class_AnimatedSprite_play: - void **play** **(** :ref:`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).