Files
quro-animation-tools/QURO.AnimationLibrary/Animation.cs
T
quinnvoker f57a0334cf AnimationEditor Functional
Everything needed to make use of AnimationEditor is now included!
2018-11-25 15:51:51 -08:00

42 lines
1009 B
C#

using Microsoft.Xna.Framework;
namespace QURO.AnimationLibrary
{
public class Animation
{
public string Name { get; set; }
public bool IsLooping { get; set; }
public Frame[] Frames { get; set; }
public bool IsStillImage => Frames.Length <= 1;
public Animation()
{
Name = "unnamed";
Frames = new Frame[] { new Frame() };
IsLooping = false;
}
public Animation(string name, Frame[] frames, bool loop)
{
Name = name;
Frames = frames;
IsLooping = loop;
}
public Animation(string name, Rectangle[] sourceRects, float delay, bool loop)
{
Name = name;
Frames = new Frame[sourceRects.Length];
for(int index = 0; index < sourceRects.Length; index++)
{
Frames[index] = new Frame(sourceRects[index], delay);
}
IsLooping = loop;
}
}
}