spriteanim make function

This commit is contained in:
John Alanbrook 2023-12-28 20:34:00 +00:00
parent 705c793bb1
commit 192c253f12

View file

@ -164,6 +164,12 @@ sprite.inputs.kp1 = function() { this.pos = this.dimensions().scale([-1,-1]); };
Object.seal(sprite);
var SpriteAnim = {
make(path) {
if (path.ext() === 'gif')
return SpriteAnim.gif(path);
else if (Resources.is_image(path))
return SpriteAnim.strip(path);
},
gif(path) {
var anim = {};
anim.frames = [];