AnimatedSprite

    Category: Core

    Sprite node that can use multiple textures for animation.

    Properties

    is_playing ( ) const
    void ( String anim=”“, backwards=false )
    voidstop ( )

    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
    Setterset_animation(value)
    Getterget_animation()

    If true, texture will be centered. Default value: true.


    • flip_h
    Setterset_flip_h(value)
    Getteris_flipped_h()

    If , texture is flipped horizontally. Default value: false.


    Setterset_flip_v(value)
    Getteris_flipped_v()

    If true, texture is flipped vertically. Default value: false.


    The displayed animation frame’s index.


    • frames
    Setterset_sprite_frames(value)
    Getterget_sprite_frames()

    The SpriteFrames resource containing the animation(s).


    • offset
    Setterset_offset(value)
    Getterget_offset()

    If , the is currently playing.


    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).