AnimatedSprite
Category: Core
Sprite node that can use multiple textures for animation.
Properties
is_playing ( ) const | |
void | ( String anim=”“, backwards=false ) |
void | stop ( ) |
Signals
- 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.
Animations are created using a SpriteFrames resource, which can be configured in the editor via the SpriteFrames panel.
Property Descriptions
- animation
Setter | set_animation(value) |
Getter | get_animation() |
- bool centered
If true
, texture will be centered. Default value: true
.
- flip_h
Setter | set_flip_h(value) |
Getter | is_flipped_h() |
If , texture is flipped horizontally. Default value: false
.
- bool flip_v
Setter | set_flip_v(value) |
Getter | is_flipped_v() |
If true
, texture is flipped vertically. Default value: false
.
The displayed animation frame’s index.
- frames
Setter | set_sprite_frames(value) |
Getter | get_sprite_frames() |
The SpriteFrames resource containing the animation(s).
- offset
Setter | set_offset(value) |
Getter | get_offset() |
- bool playing
If , the is currently playing.
- float speed_scale
The animation speed is multiplied by this value.
- is_playing ( ) const
Returns true
if an animation if currently being played.
- void play ( String anim=”“, backwards=false )
Play the animation set in parameter. If no parameter is provided, the current animation is played. Property backwards
plays the animation in reverse if set to true
.
Stop the current animation (does not reset the frame counter).