Extensions & Frame Restructuring
Implemented Custom Extensions for SpriteMaps (*.smap), Animations (*.anim) and AnimationSets (*.animset). Also restructured Frame to be a container for SpriteMapRegions rather than an extension of them. This will enable easier access to updating them when loading SpriteMaps in the Editor.
This commit is contained in:
@@ -11,11 +11,8 @@ namespace QURO.AnimationLibrary
|
||||
|
||||
public bool IsStillImage => Frames.Length <= 1;
|
||||
|
||||
public Animation()
|
||||
public Animation() : this("unnamed", new Frame[] { new Frame() }, false)
|
||||
{
|
||||
Name = "unnamed";
|
||||
Frames = new Frame[] { new Frame() };
|
||||
IsLooping = false;
|
||||
}
|
||||
|
||||
public Animation(string name, Frame[] frames, bool loop)
|
||||
@@ -24,18 +21,5 @@ namespace QURO.AnimationLibrary
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user