SpriteFrames

    Category: Core

    Sprite frame library for AnimatedSprite.

    Properties

    void ( String anim )
    void ( String anim, frame, int at_position=-1 )
    void ( String anim )
    void ( )
    bool ( String anim ) const
    get_animation_names ( ) const
    get_animation_speed ( anim ) const
    Texture ( String anim, idx ) const
    int ( String anim ) const
    has_animation ( anim ) const
    voidremove_animation ( anim )
    voidremove_frame ( anim, int idx )
    void ( String anim, newname )
    voidset_animation_loop ( anim, bool loop )
    void ( String anim, speed )
    voidset_frame ( anim, int idx, txt )

    Description

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

    • frames

    Method Descriptions

    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.


    • get_frame ( String anim, idx ) const

    Returns the animation’s selected frame.



    • bool has_animation ( anim ) const

    If , the named animation exists.


    • void remove_animation ( String anim )

    Removes the given animation.


    • void remove_frame ( anim, int idx )

    Removes the animation’s selected frame.


    • void rename_animation ( anim, String newname )

    Changes the animation’s name to .


    • void set_animation_loop ( anim, bool loop )

    If , the animation will loop.


    • void set_animation_speed ( anim, float speed )

    • void set_frame ( anim, int idx, txt )

    Sets the texture of the given frame.