Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
AnimatedSprite2D¶
Inherits: Node2D < CanvasItem < Node < Object
Sprite node that contains multiple textures as frames to play for animation.
Description¶
AnimatedSprite2D is similar to the Sprite2D node, except it carries multiple textures as animation frames. Animations are created using a SpriteFrames resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The SpriteFrames resource can be configured in the editor via the SpriteFrames bottom panel.
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Methods¶
get_playing_speed ( ) const |
|
is_playing ( ) const |
|
void |
pause ( ) |
void |
play ( StringName name=&"", float custom_speed=1.0, bool from_end=false ) |
void |
play_backwards ( StringName name=&"" ) |
void |
set_frame_and_progress ( int frame, float progress ) |
void |
stop ( ) |
Signals¶
animation_changed ( )
Emitted when animation changes.
animation_finished ( )
Emitted when the animation reaches the end, or the start if it is played in reverse. When the animation finishes, it pauses the playback.
animation_looped ( )
Emitted when the animation loops.
frame_changed ( )
Emitted when frame changes.
sprite_frames_changed ( )
Emitted when sprite_frames changes.
Property Descriptions¶
StringName animation = &"default"
void set_animation ( StringName value )
StringName get_animation ( )
The current animation from the sprite_frames resource. If this value is changed, the frame counter and the frame_progress are reset.
String autoplay = ""
The key of the animation to play when the scene loads.
bool centered = true
If true
, texture will be centered.
bool flip_h = false