Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huxingyi/squeezer
Texture Packer for Game Development Using MaxRects Algorithm
https://github.com/huxingyi/squeezer
Last synced: 2 months ago
JSON representation
Texture Packer for Game Development Using MaxRects Algorithm
- Host: GitHub
- URL: https://github.com/huxingyi/squeezer
- Owner: huxingyi
- Created: 2016-07-11T05:09:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-06-24T21:20:53.000Z (over 4 years ago)
- Last Synced: 2024-08-04T02:10:43.100Z (5 months ago)
- Language: C
- Size: 1.94 MB
- Stars: 69
- Watchers: 7
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
- AwesomeCppGameDev - squeezer
README
Overview [![Build Status](https://travis-ci.org/huxingyi/squeezer.svg?branch=master)](https://travis-ci.org/huxingyi/squeezer) [![Build status](https://ci.appveyor.com/api/projects/status/h9vckwyht5e0pj87/branch/master?svg=true)](https://ci.appveyor.com/project/huxingyi/squeezer/branch/master)
------------
**Texture Packer** for Game Development Using MaxRects Algorithm.
*Note: The game assets used in this example were download from [Grassland Tileset](http://opengameart.org/content/grassland-tileset), thanks `Clint Bellanger` for made so many awesome game resources.*
Contributing
--------------
Don't hesitate to make a pull request. All kinds of contribution are welcome.
*Note: Please follow the coding style of the existed codes.*Building(Linux/OSX)
---------------
```sh
$ cd ./src
$ make
```Building(Windows)
--------------
```sh
$ cd .\src
$ nmake -f Makefile.mak
```Usage
--------------
```sh
usage: squeezerw [options]
options:
--width
--height
--allowRotations <1/0/true/false/yes/no>
--border <1/0/true/false/yes/no>
--outputTexture
--outputInfo
--infoHeader
--infoBody
--infoSplit
--infoFooter
--verbose
--version
format specifiers of infoHeader/infoBody/infoFooter:
%W: output width
%H: output height
%n: image name
%w: image width
%h: image height
%x: left on output image
%y: top on output image
%l: trim offset left
%t: trim offset top
%c: original width
%r: original height
%f: 1 if rotated else 0
and '\n', '\r', '\t'
```Example
------------
```sh
$ cd ./src
$ make$ ./squeezerw ../example/images --verbose --width 512 --height 256 --border 1 --outputTexture ../example/squeezer.png --outputInfo ../example/squeezer.xml
$ ./squeezerw ../example/images --verbose --width 512 --height 256 --border 1 --outputTexture ../example/squeezer.png --outputInfo ../example/squeezer.json --infoHeader "{\"textureWidth\":\"%W\", \"textureHeight\":\"%H\", \"items\":[\n" --infoFooter "]}" --infoBody "{\"name\":\"%n\", \"width\":\"%w\", \"height\":\"%h\", \"left\":\"%x\", \"top\":\"%y\", \"rotated\":\"%f\", \"trimOffsetLeft\":\"%l\", \"trimOffsetTop\":\"%t\", \"originWidth\":\"%c\", \"originHeight\":\"%r\"}" --infoSplit "\n,"
```Licensing
-----------------
Licensed under the MIT license except lodepng.c and lodepng.h.*Note: [lodepng](https://github.com/lvandeve/lodepng) used in this project to decode and encode png format. For the license used in lodepng please visit [lodepng](https://github.com/lvandeve/lodepng) directly.*
References
------------
1. http://www.blackpawn.com/texts/lightmaps/
2. http://clb.demon.fi/projects/more-rectangle-bin-packing
3. http://wiki.unity3d.com/index.php?title=MaxRectsBinPack
4. https://github.com/juj/RectangleBinPack
5. http://opengameart.org/content/flare-weapon-icons-2