#sprite-sheet #sprite #gamedev #generate

nightly app corral

A simple sprite sheet packer

5 releases

0.1.5 Feb 13, 2023
0.1.4 Oct 12, 2022
0.1.3 Oct 12, 2022
0.1.1 Oct 4, 2022
0.1.0 Sep 27, 2022

#2538 in Command line utilities

21 downloads per month

MIT license

43KB
1K SLoC

Corral

A Simple Sprite Sheet Packer

Corral creates a sprite sheet and data from a folder of images. Corral supports generating json or lua data.

Usage:

corral input/to/assets output.png

Example Output

packed sprite sheet

json excerpt

[{"name":"img_file_name_1","x": 2,"y": 2,"width": 256,"height": 64}...]

Usage, lua data:

corral test/squares-different-sizes Squares.png --data-fmt=lua

lua exceprt

local Squares = {
    RECTANGLE_1 = {
        x = 2,
        y = 2,
        width = 64,
        height = 64,
    },
    RECTANGLE_3 = {
        x = 68,
        y = 2,
        width = 32,
        height = 32,
    },
    RECTANGLE_2 = {
        x = 2,
        y = 68,
        width = 16,
        height = 16,
    },
    RECTANGLE_4 = {
        x = 2,
        y = 86,
        width = 8,
        height = 8,
    }
}

return Squares

Dependencies

~13MB
~60K SLoC