SpriteFrames

    Sprite frame library for AnimatedSprite.

    Sprite frame library for . Contains frames and animation data for playback.

    Note: You can associate a set of normal maps by creating additional resources with a _normal suffix. For example, having 2 SpriteFrames resources and run_normal will make it so the run animation uses the normal map.

    voidadd_animation ( anim )
    voidadd_frame ( anim, Texture frame, at_position=-1 )
    voidclear ( anim )
    voidclear_all ( )
    get_animation_loop ( anim ) const
    PoolStringArray ( ) const
    float ( String anim ) const
    get_frame ( anim, int idx ) const
    get_frame_count ( anim ) const
    bool ( String anim ) const
    void ( String anim )
    void ( String anim, idx )
    voidrename_animation ( anim, String newname )
    void ( String anim, loop )
    voidset_animation_speed ( anim, float speed )
    void ( String anim, idx, Texture txt )
    • frames

    Compatibility property, always equals to an empty array.

    Adds a new animation to the library.


    • void add_frame ( String anim, frame, int at_position=-1 )

    Adds a frame to the given animation.


    • void clear ( anim )

    • void clear_all ( )

    Removes all animations. A “default” animation will be created.


    • bool get_animation_loop ( anim ) const

    If , the given animation will loop.


    Returns an array containing the names associated to each animation. Values are placed in alphabetical order.


    • get_animation_speed ( String anim ) const

    The animation’s speed in frames per second.


    Returns the animation’s selected frame.


    • get_frame_count ( String anim ) const

    Returns the number of frames in the animation.


    • has_animation ( String anim ) const

    • void remove_animation ( anim )

    Removes the given animation.


    • void remove_frame ( String anim, idx )

    Removes the animation’s selected frame.


    • void rename_animation ( String anim, newname )

    Changes the animation’s name to newname.


    • void set_animation_loop ( String anim, loop )

    If , the animation will loop.


    The animation’s speed in frames per second.


    Sets the texture of the given frame.