.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _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:`String` | :ref:`get_animation` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_frame` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_offset` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`SpriteFrames` | :ref:`get_sprite_frames` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_centered` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_flipped_h` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_flipped_v` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_playing` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`play` **(** :ref:`String` anim="" **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_animation` **(** :ref:`String` animation **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_centered` **(** :ref:`bool` centered **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_flip_h` **(** :ref:`bool` flip_h **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_flip_v` **(** :ref:`bool` flip_v **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_frame` **(** :ref:`int` frame **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_offset` **(** :ref:`Vector2` offset **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_sprite_frames` **(** :ref:`SpriteFrames` sprite_frames **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`stop` **(** **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- - **finished** **(** **)** Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted everytime the last frame is drawn, before looping. - **frame_changed** **(** **)** Emitted when frame is changed. Description ----------- Sprite node that can use multiple textures for animation. Member Function Description --------------------------- .. _class_AnimatedSprite_get_animation: - :ref:`String` **get_animation** **(** **)** const Return the name of the current animation set to the node. .. _class_AnimatedSprite_get_frame: - :ref:`int` **get_frame** **(** **)** const Return the visible frame index. .. _class_AnimatedSprite_get_offset: - :ref:`Vector2` **get_offset** **(** **)** const Return the offset of the sprite in the node origin. .. _class_AnimatedSprite_get_sprite_frames: - :ref:`SpriteFrames` **get_sprite_frames** **(** **)** const Get the :ref:`SpriteFrames` resource, which contains all frames. .. _class_AnimatedSprite_is_centered: - :ref:`bool` **is_centered** **(** **)** const Return true when centered. See :ref:`set_centered`. .. _class_AnimatedSprite_is_flipped_h: - :ref:`bool` **is_flipped_h** **(** **)** const Return true if sprite is flipped horizontally. .. _class_AnimatedSprite_is_flipped_v: - :ref:`bool` **is_flipped_v** **(** **)** const Return true if sprite is flipped vertically. .. _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_set_animation: - void **set_animation** **(** :ref:`String` animation **)** Set the current animation of the node and reinits the frame counter of the animation. .. _class_AnimatedSprite_set_centered: - void **set_centered** **(** :ref:`bool` centered **)** When turned on, offset at (0,0) is the center of the sprite, when off, the top-left corner is. .. _class_AnimatedSprite_set_flip_h: - void **set_flip_h** **(** :ref:`bool` flip_h **)** If true, sprite is flipped horizontally. .. _class_AnimatedSprite_set_flip_v: - void **set_flip_v** **(** :ref:`bool` flip_v **)** If true, sprite is flipped vertically. .. _class_AnimatedSprite_set_frame: - void **set_frame** **(** :ref:`int` frame **)** Set the visible sprite frame index (from the list of frames inside the :ref:`SpriteFrames` resource). .. _class_AnimatedSprite_set_offset: - void **set_offset** **(** :ref:`Vector2` offset **)** Set the offset of the sprite in the node origin. Position varies depending on whether it is centered or not. .. _class_AnimatedSprite_set_sprite_frames: - void **set_sprite_frames** **(** :ref:`SpriteFrames` sprite_frames **)** Set the :ref:`SpriteFrames` resource, which contains all frames. .. _class_AnimatedSprite_stop: - void **stop** **(** **)** Stop the current animation (does not reset the frame counter).