texture_atlas_transformer 1.0.0 texture_atlas_transformer: ^1.0.0 copied to clipboard
A Pub transformer to build Texture Atlas JSON files.
texture_atlas_transformer #
A transformer to build JSON Atlas files for inclusion in games.
Example pubspec.yaml
:
transformers:
- texture_atlas_transformer:
output_dir: web/assets/textures
scale: 0.125
files:
flying:
animations:
fly:
cells: all
loop: true
speed: 0.1
frames:
- "web/assets/green_flapper/Transparent PNG/flying/*.png"
Options #
output_dir
: Output directory to generate files into.scale
: Either anum
or aMap
(ex.{'x': 0.5, 'y': 1.0}
). This ratio is applied to every frame.resize
: Same asscale
; however, each frame is resized to the exact size, instead of being scaled.files
: AMap
ofString
s to atlas definitions.
Atlas Definitions #
frames
: AList
of Strings representing files to be combined. Supports globbing.animations
: AMap
ofString
s to animations.
Animations #
cells
: A String of cells to animate. Either'all'
or an explicit (ex.1,2,3
).loop
: Abool
; defaults tofalse
.speed
: Adouble
; defaults to1.0
.