#graphics #2d #game

aseprite

A crate to load files from the aseprite sprite editor

4 releases

Uses old Rust 2015

0.1.3 Jun 3, 2017
0.1.2 Apr 27, 2017
0.1.1 Apr 25, 2017
0.1.0 Apr 25, 2017

#102 in #2d

Download history 125/week @ 2021-08-11 84/week @ 2021-08-18 23/week @ 2021-08-25 69/week @ 2021-09-01 60/week @ 2021-09-08 27/week @ 2021-09-15 84/week @ 2021-09-22 23/week @ 2021-09-29 29/week @ 2021-10-06 26/week @ 2021-10-13 24/week @ 2021-10-20 15/week @ 2021-10-27 29/week @ 2021-11-03 4/week @ 2021-11-10 21/week @ 2021-11-17 41/week @ 2021-11-24

96 downloads per month
Used in 9 crates (3 directly)

MIT license

8KB
185 lines

aseprite

A crate for loading data from the aseprite sprite editor. Should go along well with the tiled crate, I hope!

It does not load any actual images, just the metadata. Currently it only loads aseprite's JSON export format, and only when exported in the "json-array" format (which isn't the default for some reason but appears much more sensible than the alternative).

Automatically exporting a sprite to a given format is documented here: https://www.aseprite.org/docs/cli/

Docs

Documentation is on docs.rs

Example

Export sprite sheet with:

aseprite -b boonga.ase --sheet boonga.png --format json-array --list-tags --list-layers --data boonga.json

Then write a program to load it:

extern crate serde_json;
extern crate aseprite;

use std::fs::File;

fn main() {
   let file = File::open("boonga.json").unwrap();
   let spritesheet: aseprite::SpritesheetData = serde_json::from_reader(file).unwrap();
   println!("Spritesheet is {:?}", spritesheet);
}

Dependencies

~0.9–1.6MB
~37K SLoC

2Y