Crates.io | sprongen |
lib.rs | sprongen |
version | 0.0.2 |
source | src |
created_at | 2020-01-15 12:10:27.540147 |
updated_at | 2020-01-15 19:55:13.234225 |
description | Generate RON files for the given spritesheet PNG images |
homepage | |
repository | https://github.com/Noah2610/sprongen |
max_upload_size | |
id | 198614 |
size | 30,327 |
sprongen
Spr
itesheet
RON
Gen
erator
Generates RON spritesheet config files for your spritesheet PNG images.
The spritesheet configs are generated in the format used by the amethyst
engine.
Generated RON files are placed next to the corresponding PNG image file. (TODO: make this configurable)
cargo install sprongen
Clone this repo ...
git clone https://github.com/Noah2610/sprongen
Install with cargo
...
cargo install --path sprongen/ --force
sprongen --help
sprongen 0.0.1
Generate RON files for the given spritesheet PNG images
USAGE:
sprongen [FLAGS] [OPTIONS] <FILES>...
FLAGS:
-h, --help
Prints help information
-p, --pretty
Pretty format the generated RON files.
Without this, generated RON files will have no new-lines/spacing.
-V, --version
Prints version information
-v, --verbose
Enable verbose logging.
Prints information about used options, what PNG files are read, and what RON files are being generated. Is
printed to stderr.
OPTIONS:
-s, --tile-size <tile-size>
Use the given tile size.
<tile-size> format is `<width>x<height>`, where <width> and <height> are positive integers. [default: 32x32]
ARGS:
<FILES>...
Let's say we have a directory spritesheets/
in which we have a bunch of
PNG spritesheet images, for which we want to create RON config files.
Our file structure may look something like this ...
spritesheets/
├── player.png
└── tiles.png
Some meta details about our example spritesheets:
player.png
32x64
pixels.tiles.png
16x16
pixels.Now, we want to generate RON config files, which we will use in our amethyst
game.
These config files need to define each sprite's position and size in our spritesheets.
To generate the RON files, keeping our details listed above in mind, use sprongen
like so ...
sprongen -vp --tile-size 32x64 spritesheets/player.png
sprongen -vp --tile-size 16x16 spritesheets/tiles.png
-s
or --tile-size
-v
or --verbose
-p
or --pretty
After this, our new file structure would look something like this ...
spritesheets/
├── player.png
├── player.ron
├── tiles.png
└── tiles.ron
Distributed under the terms of the MIT license.