AnimatedSprite
Sprite node that contains multiple textures as frames to play for animation.
is similar to the 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 resource can be configured in the editor via the SpriteFrames bottom panel.
Note: You can associate a set of normal or specular maps by creating additional SpriteFrames resources with a _normal
or _specular
suffix. For example, having 3 resources run
, run_normal
, and run_specular
will make it so the run
animation uses normal and specular maps.
Tutorials
Methods
void | |
void | ( ) |
- 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.
- frame_changed ( )
Emitted when changed.
Property Descriptions
- animation
Default |
|
Setter | set_animation(value) |
Getter | get_animation() |
The current animation from the frames resource. If this value changes, the frame
counter is reset.
- centered
If true
, texture will be centered.
Default |
|
Setter | set_flip_h(value) |
Getter | is_flipped_h() |
If , texture is flipped horizontally.
- bool flip_v
Default |
|
Setter | set_flip_v(value) |
Getter | is_flipped_v() |
If true
, texture is flipped vertically.
- frame
The displayed animation frame’s index.
- SpriteFrames frames
Setter | set_sprite_frames(value) |
Getter | get_sprite_frames() |
The resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the SpriteFrames resource.
- offset
Default |
|
Setter | set_offset(value) |
Getter | get_offset() |
The texture’s drawing offset.
- bool playing
If true
, the is currently playing.
- float speed_scale
Default |
|
Setter | set_speed_scale(value) |
Getter | get_speed_scale() |
The animation speed is multiplied by this value.
- void stop ( )
Stops the current animation (does not reset the frame counter).