For reasons as performance and saving video ram memory during runtime packaging images is advised. Libgdx’s comes with a TexturePacker that does exactly that. It even has a wonderful GUI.
Our project has a lot of images that change all the time as we continue making the game. It would be a waste of time to do it by hand each time something changes. That is why months ago, or even a year, I devised an automatic way of running the TexturePacker. I hooked the task into our build process so that every time the projects runs it packages and uses the newest resources.
The TexturePacker might take a long time to run, especially when you have hundreds of images. That’s why I took advantage of SBT’s built in cache system. It’s possible to associate a task with a bunch of input files and cache the modification date. Same applies to the output files. That way the task only runs if something changed, otherwise it just does a no-op.
Having this and not sharing is not nice at all. I just finished extracting it into a plugin and publishing the first iteration of the texture-packer-plugin. If you are making games with Scala and SBT you can now use it too! Read instructions carefully and in case of doubt just ask here on the comments or send us an e-mail.
It is possible to call the sbt task from the command-line so ant or maven builds could take advantage of it even if not using Scala. Some work might be necessary and won’t be as fast as having SBT always open but it might be not so bad. Let me know if you need a hand with something like this too.
For the Java users out there please remember that I like my bread with peanut butter and jelly


Art by Ismael Bergara.