module
Version:
v1.0.0
Opens a new window with list of versions in this module.
Published: Apr 13, 2025
License: MIT
Opens a new window with license information.
README
¶
🧩 SpritePacker | 精灵图打包工具
SpritePacker is a 2D sprite sheet packing tool, designed for game developers
📦 Installation | 安装
go get -u github.com/91xusir/spritepacker
or
git clone https://github.com/91xusir/spritepacker.git
cd spritepacker
go build .
🛠 Usage | 使用方式
CLI 命令行
Options 参数说明
| Flag |
Description (EN) |
描述(中文) |
-input |
Input image folder |
输入图片文件夹 |
-output |
Output atlas & metadata directory |
输出图集和元数据目录 |
-maxw |
Maximum atlas width |
最大图集宽度 |
-maxh |
Maximum atlas height |
最大图集高度 |
-trim |
Trim transparent edges |
裁剪透明边缘 |
-rotate |
Allow 90-degree rotation |
允许旋转优化 |
-autosize |
Auto resize the canvas |
自动调整尺寸 |
-format |
Output format (json, xml, etc.) |
输出格式(json、xml 等) |
📂 Output Example | 输出示例
├── atlas.png # Packed texture 图集
├── atlas.json # Metadata 元数据(包含坐标、尺寸等)
🧠 Algorithm | 算法
🧪 Go API Example | Go 语言调用示例
Directories
¶
Package main provides a command-line tool for sprite atlas packing and unpacking.
|
Package main provides a command-line tool for sprite atlas packing and unpacking. |
Package pack provides texture packing utilities, including support for rotation, transparent pixel trimming, automatic resizing and so on.
|
Package pack provides texture packing utilities, including support for rotation, transparent pixel trimming, automatic resizing and so on. |
Click to show internal directories.
Click to hide internal directories.