A haxelib meant for parsing the Asprite JSON format & making a frame atlas.
Install by typing haxelib install asepriteatlas
in any shell such as command prompt.
- Properly tag your animations.
- Select all frames.
- File > Export Sprite Sheet
- (optional) Edit the "Borders" tab for optimization
- Go to output and enable both JSON and PNG output.
- Export!
- Add to Project.xml
- Initiate an FlxSprite. (flixel.FlxSprite)
- Set the FlxSprite variable "frames" to "asepriteatlas.AsepriteAtlasFrames.fromI8('assets/images/spr.png', 'assets/images/spr.json')";
- For every animation you want, use "animation.addByPrefix('yourAnimName', 'Tag Name', 12, false, false, false);"
- Add it to the game & play animation using "animation.play('yourAnimName', true);"
- Compile
Visual example: