Giter Site home page Giter Site logo

peachy's Introduction

Peachy

A parser/renderer for Aseprite animations in LÖVE.

How to use

Draw some animations in Aseprite and export the file as a spritesheet: Aseprite export

Make sure that you export JSON data with frame tags and that you have at least one tag defined. Even if there is a single animation in the file, you still need to set up frame tags.

-- Load an aseprite animation file called spinner.json, with the image
-- spinner.png & start with the animation tag "Spin"
spinner = peachy.new("spinner.json", love.graphics.newImage("spinner.png"), "Spin")

function love.draw()
  -- Draw at 50,50
  spinner:draw(50, 50)
end

function love.update(dt)
  spinner:update(dt)
end

If you don't specify an image to load in new by passing nil or false as the second argument, then peachy will attempt to load the image specified in the data file. This can cause problems: see limitations below.

Examples

See main.lua for further examples:

Peachy example

Documentation

Documentation is hosted on GitHub pages from the docs folder in this repository.

They're written in LDoc in peachy.lua if you want to make a change to them.

Building

If you want to build the documentation yourself for whatever reason then:

  • install LDoc
  • Run ldoc.lua peachy.lua -d docs

This will build them into the docs directory.

Limitations

  • By default Aseprite will export a non-relative path as the image file. This is problematic because LÖVE will refuse to load it and it's non-portable. There's a workaround listed here. Either specify the image yourself in peachy.new, edit the JSON manually or use the CLI.
  • Exported sprite sheets must be exported as an array, not as a hash table.

Export as array

peachy's People

Contributors

josh-perry avatar flamendless avatar lenndg avatar rhroberts avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.