Sprite frame library for AnimatedSprite.
    public class SpriteFrames : Resource

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

Inheritance Chain

Constructors

    public SpriteFrames()

Properties

    public Array Animations { get; set; }

    public Array Frames { get; set; }

Methods

    public void AddAnimation(string anim)

Adds a new animation to the the library.

    public void AddFrame(string anim, Texture frame, int atPosition = -1)

Adds a frame to the given animation.

    public void Clear(string anim)

Removes all frames from the given animation.

    public void ClearAll()

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

    public bool GetAnimationLoop(string anim)

If true the given animation will loop.

    public float GetAnimationSpeed(string anim)

The animation’s speed in frames per second.

    public Texture GetFrame(string anim, int idx)

Returns the animation’s selected frame.

    public int GetFrameCount(string anim)

Returns the number of frames in the animation.

    public bool HasAnimation(string anim)

If true the named animation exists.

    public void RemoveAnimation(string anim)

Removes the given animation.

    public void RemoveFrame(string anim, int idx)

Removes the animation’s selected frame.

    public void RenameAnimation(string anim, string newname)

Changes the animation’s name to newname.

    public void SetAnimationLoop(string anim, bool loop)

If true the animation will loop.

    public void SetAnimationSpeed(string anim, float speed)

The animation’s speed in frames per second.

    public void SetFrame(string anim, int idx, Texture txt)

Sets the texture of the given frame.

Tags: