Reputation: 197
I've been looking for the skinpacker from the libgdx SVN without success. and then I learn it's no longer exist. SO, the question is how do I create a skin.json file to use in my libgdx project. Do you know any tools that allow me to work with GUI to create a skin. THank you.
Upvotes: 2
Views: 3292
Reputation: 56640
As Gnurfos says, you need to run TexturePacker2
to generate the skin files. I found it helpful to set up a helper class so I don't have to remember all the path information.
public class AssetPacker {
public static void main(String[] args) throws Exception {
TexturePacker2.process(
"assets-raw/skin",
"../vograbulary-android/assets/data/ui",
"uiskin.atlas");
}
}
Here are some related notes from my project's README file.
To edit the graphics files, edit the contents of vograbulary-test/assets-raw, and then run vograbulary-test/src/com.github.donkirkby.vograbulary.AssetPacker. To change the font, follow the instructions for running Hiero. Launch Hiero, open the vograbulary-test/assets-raw/default.hiero settings file, and then save the font file over vograbulary-android/assets/data/ui/default.fnt. That will also generate default.png, which you need to move back to vograbulary-test/assets-raw/skin/default.png. Finally, run the AssetPacker again.
The original creation of the skin is described in another question.
Upvotes: 2
Reputation: 1010
With the latest versions, you don't need the SkinPacker.jar anymore.
Here's how I do it:
CLASSPATH=$LIB_DIR/gdx-tools.jar:$LIB_DIR/gdx.jar
CLASSNAME=com.badlogic.gdx.tools.imagepacker.TexturePacker2
INPUTDIR=uiskin_elements
OUTPUTDIR=.
java -classpath $CLASSPATH $CLASSNAME $INPUTDIR $OUTPUTDIR uiskin.atlas
This generates a uiskin.atlas and uiskin.png, assuming you put all .png in a directory called uiskin_elements.
Upvotes: 1