Sprite node that can use multiple textures for animation.
- 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 frame changed.
- String animation - The current animation from the
framesresource. If this value changes, the
framecounter is reset.
- bool centered - If
truetexture will be centered. Default value:
- bool flip_h - If
truetexture is flipped horizontally. Default value:
- bool flip_v - If
truetexture is flipped vertically. Default value:
- int frame - The displayed animation frame’s index.
- SpriteFrames frames - The SpriteFrames resource containing the animation(s).
- Vector2 offset - The texture’s drawing offset.
- bool playing - If
truethe animation is currently playing.
Animations are created using a SpriteFrames resource, which can be configured in the editor via the SpriteFrames panel.
Member Function Description¶
- bool is_playing ( ) const
Return true if an animation if currently being played.
- void play ( String anim=”” )
Play the animation set in parameter. If no parameter is provided, the current animation is played.
- void stop ( )
Stop the current animation (does not reset the frame counter).