1 decade ago by Vlad
I have a situation where I'd benefit from AnimationSheet object where I don't have to specify frame size in pixels but instead frame count per image. In particular, trying to deliver a game to multiple platforms in native resolution (say, web, iPhone, iPhone 4, iPad, ...) and at 1:1 scale, I need to change the code for each.
I propose the AnimationSheetFrames object which extends AnimationSheet and takes instead of width and height in pixels, width and height in frames. To get to pixels the class would simply divide image width and height with this numbers respectively.
I intend to write such an object but I guess I'd have to hook it into Image object's loading flow and specify AnimationSheet dims once the image size is known. I also suppose that common usage of Animation is through init() meaning AnimationSheets (if, again commonly instantiated as class properties) would be defined, images loaded (and dims known) before the Animation objects are spawned.
I propose the AnimationSheetFrames object which extends AnimationSheet and takes instead of width and height in pixels, width and height in frames. To get to pixels the class would simply divide image width and height with this numbers respectively.
I intend to write such an object but I guess I'd have to hook it into Image object's loading flow and specify AnimationSheet dims once the image size is known. I also suppose that common usage of Animation is through init() meaning AnimationSheets (if, again commonly instantiated as class properties) would be defined, images loaded (and dims known) before the Animation objects are spawned.