Getting started
Introduction
A Gradle plugin witch automatically packs texture for a libgdx game, using libgdx texture packer. Before packing, the plugin can do some actions on the resources provided, such as:
- Resize images for variants
- Convert SVG to PNG images
Install
To apply the plugin, please add one of the following snippets to your build.gradle file:
Gradle >= 2.1
build.gradle
plugins {
id "com.eowise.packer" version "0.7.0"
}
Or
Gradle < 2.1
build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.eowise:packer:0.7.0'
}
}
apply plugin: 'packer'
Basic usage
A very basic scenario :
task packs(type: com.eowise.packer.Packer) {
resourcesInputPath 'path/to/resources'
atlasesOutputPath 'path/to/atlases'
}
This task will do the folowing actions :
- Convert all SVGs to PNGs in the 'path/to/resources' tree
- Copy all PNGs do a working directory
- Copy all file named 'pack.json' from the resouces path to the working directory
- Call the libgdx texture packer to packs the textures from the working directory into the 'path/to/atlases' directory (generally android assets directory)