Closed emign closed 4 years ago
Can you provide a sample file of each?
There are bunch of different popular formats.
added some links
We are already supporting atlases. Maybe what we can do is to be able to construct a SpriteAnimation out of it? Since they are named and might have several animations, maybe we can provide a prefix. For example: For "RunRight01.png" we can say: construct an animation for "RunRight" with 16.milliseconds per frame. No prefix "" would grab all the textures in the atlas. Then it gets all the textures starting with RunRight, sort them, and constructs the animation. That would work for you?
so you only want to support the atlas files?
As far as I'm concerned the files you uploaded, are atlases (open those files in a text editor and compare with other atlases). I wouldn't support the CSS/LESS ones though.
.readAtlas(...).getAnimation("RunRight")
okay. It was a misunderstanding. I thought you were referencing the .atlas
files which are generated by phaser editor. As it turned out: phaser .atlas
files are just json hash spritesheets.
So the example jsonhash from the first post works. json array not, xml not.
So in the end I have supported XML and both JSON-based (array and hash) formats. From an atlas you can get a SpriteAnimation adding a prefix or a RegExp matching the elements you want to include there.
Documentation here: https://korlibs.soywiz.com/korge/atlas/
SpriteAnimations should be able to be generated with generic sprite sheet formats
examples:
XML css.zip json array.zip json Hash.zip less.zip