Expand description
Deterministic sprite atlas packer.
Point at a folder of PNGs, get one atlas image and a JSON sheet.
§Example
use atlaspack::{pack_directory, PackConfig};
let packed = pack_directory(
std::path::Path::new("./sprites"),
&PackConfig::default(),
)?;
println!("{} frames", packed.json.frames.len());Structs§
- Atlas
Json - JSON sidecar written next to the atlas PNG.
- Atlas
Meta - Metadata about the packed atlas image.
- Frame
- Where a sprite landed in the atlas.
- Pack
Config - Packer options.
- Packed
Atlas - Result of packing: image pixels plus JSON metadata.
- Sprite
- One input sprite after load.
Enums§
- Error
- Errors produced while loading or packing sprites.
Functions§
- load_
sprites - Load all
.pngfiles underdir(recursive). - pack_
and_ write - Pack sprites from
input_dirand write the atlas image and JSON sheet. - pack_
directory - Load PNGs from
input_dirand pack them. - pack_
images - Pack sprites already in memory into a single atlas.
Type Aliases§
- Result
- Crate-level result type.