Peachy - Aseprite animations

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
josh
Prole
Posts: 3
Joined: Fri Apr 06, 2018 8:38 am

Peachy - Aseprite animations

Post by josh »

Peachy is a parser/renderer for Aseprite animations in LÖVE. It lets you load the animation JSON and PNG spritesheet exports from Aseprite and draw them in LÖVE like so:

Code: Select all

local peachy = require("peachy")

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

function love.draw()
  spinner:draw(50, 50)
end

function love.update(dt)
  spinner:update(dt)
end
You can have many animation tags in a single Aseprite export and switch between them. Supports forward, backward and ping-pong animations. Should also work fine with padded or trimmed exports.

Check main.lua in the root of the repository for an example.

Image

GitHub repo: https://github.com/josh-perry/peachy
Docs: https://josh-perry.github.io/peachy/

Send me PRs.
User avatar
Ikroth
Citizen
Posts: 79
Joined: Thu Jul 18, 2013 4:44 am

Re: Peachy - Aseprite animations

Post by Ikroth »

Nice! I've been thinking about writing a tool just like this, but you beat me to the punch. I am looking forward to trying it out. We use Aseprite for a lot of our games but just use the regular spritesheets at the moment.
User avatar
Nuthen224
Citizen
Posts: 50
Joined: Sun Jul 28, 2013 9:40 pm

Re: Peachy - Aseprite animations

Post by Nuthen224 »

This is really cool. I notice the examples include the .aseprite files, and that the JSON files reference the .aseprite files too, but is it necessary to include them? Or is it possible for it to work with only the JSON and PNG spritesheet, without giving away the aseprite source file?
josh
Prole
Posts: 3
Joined: Fri Apr 06, 2018 8:38 am

Re: Peachy - Aseprite animations

Post by josh »

Nuthen224 wrote: Thu May 17, 2018 10:37 pm This is really cool. I notice the examples include the .aseprite files, and that the JSON files reference the .aseprite files too, but is it necessary to include them? Or is it possible for it to work with only the JSON and PNG spritesheet, without giving away the aseprite source file?
Yeah, the aseprite file isn't used at all. They're only in the repo for the sake of example and easy tinkering.
User avatar
D0NM
Party member
Posts: 250
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: Peachy - Aseprite animations

Post by D0NM »

This is a nice present for all Asesprite users. Good work, Josh!

May be I miss some options or notes here:
- How to play animation from certain frame?
- peachy:setTag (tag) <-- does it reset the animation to the 1st frame?

I cannot use it for some cut-scenes with a lot of long (not looped) animations which should be switched, restarted , etc... at certain moments.
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:
josh
Prole
Posts: 3
Joined: Fri Apr 06, 2018 8:38 am

Re: Peachy - Aseprite animations

Post by josh »

D0NM wrote: Sat May 19, 2018 7:34 pm This is a nice present for all Asesprite users. Good work, Josh!

May be I miss some options or notes here:
- How to play animation from certain frame?
- peachy:setTag (tag) <-- does it reset the animation to the 1st frame?

I cannot use it for some cut-scenes with a lot of long (not looped) animations which should be switched, restarted , etc... at certain moments.
That's a good point. There should definitely be a setFrame function and maybe a second param on setTag to jump to a specific frame. Thanks!

Fyi: you can do this atm by calling peachyThing:setTag("MyTag") and then setting peachyThing.frameIndex to be the frame number, but it's undocumented.
User avatar
D0NM
Party member
Posts: 250
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: Peachy - Aseprite animations

Post by D0NM »

yes yes, I know how to work it around.
Also You've got an untold idea about the second optional param, too ))

keep it up.

------------
I'm going to teach children soon. And I look for solutions that are easy to understand and easy to start with.
e.g. kikito's anim8 is quite simple and cool,
but I do not want children to be stuck with grids, tiles and numbers. (I've had a bad experience with it.)
I need an application where u draw a sprite
then u load the sprite and play it with love2d.


PS In our own animation library we define the anchor point of the sprite.
Image
What if the user of your library wants to set the center of the sprite to a certain point?
I dunno if Acesprite exports some meta data that could help the user to define such points right in the editor.
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:
kirhgoff
Prole
Posts: 1
Joined: Sun Jun 03, 2018 5:03 am

Re: Peachy - Aseprite animations

Post by kirhgoff »

Hey, mate, awesome library!

I added small PR https://github.com/josh-perry/peachy/pull/6 - need width and height, let me know if you need any changes. Will be happy if you merge it!
User avatar
D0NM
Party member
Posts: 250
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: Peachy - Aseprite animations

Post by D0NM »



Just recorded a video lesson on peachy +aseprite (in Russian, sorry).
:joker:
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests