Crates.io | spritesheet-generator |
lib.rs | spritesheet-generator |
version | 0.5.0 |
source | src |
created_at | 2018-07-03 14:58:14.58172 |
updated_at | 2019-06-04 21:20:00.231502 |
description | A spritesheet generator library using the piston's texture_packer |
homepage | https://github.com/rafaeldelboni/spritesheet-generator |
repository | https://github.com/rafaeldelboni/spritesheet-generator.git |
max_upload_size | |
id | 72744 |
size | 210,981 |
A spritesheet generator library using the piston's texture_packer
,
this lib provides the packed image and a json with all information following
the codeandweb's Texture Packer
basic format.
Add the crate named spritesheet-generator
to your dependencies in Cargo.toml
:
[dependencies]
spritesheet-generator = "0.5"
To export the spritesheet:
extern crate spritesheet_generator;
use spritesheet_generator::spritesheet_generator::generate;
use spritesheet_generator::spritesheet_generator_config::SpritesheetGeneratorConfig;
fn main() {
let config = SpritesheetGeneratorConfig {
max_width: 500,
max_height: 500,
border_padding: 4,
input_folder: "examples/assets/".to_string(),
output_folder: "examples/resources/".to_string(),
output_file_name: "example".to_string(),
allow_rotation: false,
};
generate(config);
}
To test the sample code, run the code below from the project directory.
# Be sure you're running this code at the root of the project directory!
cargo run --example generate-test