From 192c253f12f45a0e576d760b7f32dfdfcc7f279a Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Thu, 28 Dec 2023 20:34:00 +0000 Subject: [PATCH] spriteanim make function --- scripts/components.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/components.js b/scripts/components.js index 76f5a1b..ced6fda 100644 --- a/scripts/components.js +++ b/scripts/components.js @@ -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 = [];