litiengine
litiengine copied to clipboard
Support Aseprite export format (.json) for animations
Format Documentation:_ https://www.aseprite.org/docs/cli/#filename-format
Aseprite provides a JSON based export format for animation data. It would be great if the engine could support importing this format. Maybe even an export could be useful.
Example JSON for: "gurke-idle-right-sheet.png"
{ "frames": {
"gurke-idle-right 0.png": {
"frame": { "x": 0, "y": 0, "w": 40, "h": 40 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 40, "h": 40 },
"sourceSize": { "w": 40, "h": 40 },
"duration": 120
},
"gurke-idle-right 1.png": {
"frame": { "x": 40, "y": 0, "w": 40, "h": 40 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 40, "h": 40 },
"sourceSize": { "w": 40, "h": 40 },
"duration": 120
},
"gurke-idle-right 2.png": {
"frame": { "x": 80, "y": 0, "w": 40, "h": 40 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 40, "h": 40 },
"sourceSize": { "w": 40, "h": 40 },
"duration": 120
}
},
"meta": {
"app": "http://www.aseprite.org/",
"version": "1.2.16.3-x64",
"image": "gurke-idle-right-sheet.png",
"format": "RGBA8888",
"size": { "w": 120, "h": 40 },
"scale": "1",
"frameTags": [
],
"layers": [
{ "name": "Layer", "opacity": 255, "blendMode": "normal" }
],
"slices": [
]
}
}
I'm working in a group with @DD2480-Group-11 and we were interested in working on this. The project doesn't seem to be using any JSON libraries, would json-simple work? Also, what files would require integration (importing from toolbar etc.)?
I would recommend gson https://github.com/google/gson
I think this requires Animation to become a Resource.
Currently, you can export a spritesheet, but that's not the same as exporting an animation, as a spritesheet can have multiple animations.