spak 0.1.0

A CLI utility to pack sequential sprites into a single spritesheet. Works with procreate.
Documentation
  • Coverage
  • 0%
    0 out of 4 items documented0 out of 2 items with examples
  • Size
  • Source code size: 32.7 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.71 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 45s Average build duration of successful builds.
  • all releases: 45s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • brunorobert/spak
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • bruno-robert

Spak

Usage

You can always refer to the help with spak --help.

The CLI has two commands:

spak parse-single

Takes 1 Argument, a path to a folder containing one or more sprites (aka. images) of the same size. It will generate an output spritesheet with the same name as the input folder + how many sprites per row and how many rows are present in the spritesheet as well as the dimensions of an individual sprite.

Example: Given the following folder structure:

Star1
├── star1-01.png
├── star1-02.png
├── star1-03.png
├── star1-04.png
├── star1-05.png
├── star1-06.png
├── star1-07.png
├── star1-08.png
├── star1-09.png
├── star1-10.png
├── star1-11.png
├── star1-12.png
├── star1-13.png
├── star1-14.png
├── star1-15.png
├── star1-16.png
└── star1-17.png

Assuming each sprite is 60x60 pixels.

spak parse-single ./Star1 will output a spritesheet called Star1-5x4-(60x60).png

The output spritesheet is read from left to right and from top to bottom. The last row can contain empty pixels.

spak parse-multiple

Takes 1 Argument, a path to a directory.

This command runs spak parse-single on each subdirectory contained in the specified directory.

Project Structure

src/main.rs

Contains the CLI for spak. It uses the processor library under the hood for operations.

src/processor.rs

Contains the logic that performs sprite generation.

Build Instructions

To build the CLI, run cargo build -r

Cross-Compiling

MacOS -> Windows x86

Make sure the cross-compilation toolchain is installed

brew install mingw-w64

Then run:

cargo build -r --target x86_64-pc-windows-gnu