Skip to content

DillyzThe1/AsepriteAtlas

Repository files navigation

AsepriteAtlas

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.

Setup (Aseprite)

  1. Properly tag your animations.
    GitHub Logo
  2. Select all frames.
    GitHub Logo
  3. File > Export Sprite Sheet
  4. (optional) Edit the "Borders" tab for optimization
    GitHub Logo
  5. Go to output and enable both JSON and PNG output.
  6. Export!

Usage (HaxeFlixel)

  1. Add to Project.xml
  2. Initiate an FlxSprite. (flixel.FlxSprite)
  3. Set the FlxSprite variable "frames" to "asepriteatlas.AsepriteAtlasFrames.fromI8('assets/images/spr.png', 'assets/images/spr.json')";
  4. For every animation you want, use "animation.addByPrefix('yourAnimName', 'Tag Name', 12, false, false, false);"
  5. Add it to the game & play animation using "animation.play('yourAnimName', true);"
  6. Compile

Visual example: