https://github.com/mini2dx/tilepacker
A command line utility and Gradle task for packing individual images into tilesets
https://github.com/mini2dx/tilepacker
Last synced: 16 days ago
JSON representation
A command line utility and Gradle task for packing individual images into tilesets
- Host: GitHub
- URL: https://github.com/mini2dx/tilepacker
- Owner: mini2Dx
- License: other
- Created: 2012-08-09T19:58:51.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2023-09-24T17:44:16.000Z (over 2 years ago)
- Last Synced: 2025-03-10T19:13:31.242Z (10 months ago)
- Language: Java
- Homepage:
- Size: 5.95 MB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES
- License: LICENSE
Awesome Lists containing this project
README
tilepacker
==========
A Gradle plugin and command line utility for packing individual tile images into tilesets.
Gradle
---------
```gradle
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'org.mini2Dx:tilepacker-gradle-plugin:4.2.0'
}
}
```
Then define a task for packing up your tiles into tilesets. The tilesDirectory is where your tiles and configuration file are.
```gradle
task tilePack(type: org.tilepacker.gradle.TilePackerTask) {
tilesDirectory file("path/to/tiles/folder")
//Change to true if you do not want to use previously stored order of tiles
rewrite false
}
```
Then run the task with the ```--no-daemon``` option.
```bash
gradle tilePack --no-daemon
```
A sample configuration file can be found [here](https://raw.githubusercontent.com/tomcashman/tilepacker/master/config.sample.xml).
Command Line
---------
On the command line, the application takes a single argument - the path to the directory of the tiles and configuration file. The configuraiton file tells tilepacker which settings to apply and which files to pack into tilesets.
A sample configuration file can be found [here](https://raw.githubusercontent.com/tomcashman/tilepacker/master/config.sample.xml).
Windows
```bash
tilepacker-core.bat ./path/to/tiles/folder
```
Mac OS X / Linux
```bash
./tilepacker-core ./path/to/tiles/folder
```
Required Configuration Options
---------
* ```tileWidth``` - The width of each tile in pixels
* ```tileHeight``` - The height of each tile in pixels
* ```tilesetWidth``` - The width of each tileset in pixels
* ```tilesetHeight``` - The height of each tileset in pixels
* ```outputFormat```- The output image format (PNG or JPG)
* ```tiles``` - The list of relative paths to tile images to be packed
Optional Configuration Options
---------
* ```tilePadding``` - The padding in pixels to apply around each tile (0 by default)
* ```preventTearing``` - If you want to prevent tearing when scaling rendering, TilePacker can pad out each tile by its border pixels (false by default)
* ```premultiplyAlpha``` - If you want the output image to have premultiplied alpha values (false by default)
* ```backgroundColor``` - The background color to use in output images
* ```groupTilesByDirectory``` - True if tiles should be grouped into multiple tilesets based on their directory
Notes
---------
Older integrated graphics cards can only load textures of 512x512 pixels so it is recommended that tilesets are generated at this maximum size if you wish to support older cards.