#api #image #graphics #utility #gamedev

sheety

sheety is a sprite-sheet manipulation program written in Rust

1 unstable release

0.1.0 May 1, 2023

#871 in Images

36 downloads per month
Used in sheety-cli

MIT license

29KB
523 lines

Sheety

Sheety is a sprite-sheet manipulation program written in Rust. It has a Rust library crate for its API and a binary crate for a CLI app built on top of the API. Maybe even a GUI if I feel like it/have time for it.

Todo:

  • API
    • reordering of sprites
    • sprite-sheet concatenation
    • sprite import
    • sprite-sheet import
    • individual sprites export
    • sprite-sheet export
    • documentation
  • CLI
  • publish on crates.io
  • GUI (maybe)

lib.rs:

[sheety][crate] can be used to manipulate sprite sheets. A sprite sheet can be created using [SpriteSheet]. SpriteSheet::new creates a new empty sprite sheet, where SpriteSheet::load_div and SpriteSheet::load_cell_size are used to load a sheet from disk.

Example

This is one of this crates examples - it concatenates to existing sprite sheets into a single.

SpriteSheet::concat(
    vec![
        SpriteSheet::load_cell_size("sheety/tests/machete_idle.png", (256, 256))
            .unwrap()
            .into_unordered()
            .unwrap(),
        SpriteSheet::load_cell_size("sheety/tests/machete_swing01.png", (256, 256))
            .unwrap()
            .into_unordered()
            .unwrap(),
    ]
    .into_iter(),
    Distribution::Packed(false),
)
.unwrap()
.save("sheety/tests/result_machete.png")
.unwrap();

Dependencies

~14MB
~78K SLoC