Menu Close

Managing Graphic & Sound Assets for your libGDX Mobile Game | #4

In this post I will describe, how to manage the assets for your mobile game (graphics / design and sound). This includes some links & tips where you can find free, high quality game assets. You have at least three different ways of making a design for your mobile game:

…and there are many other resources, just use Google Search.

Creating App Icons for Android and iOS

An easy way to resize your icon for your Android and iOS mobile app is to use an icon resizer, like makeappicon.com.

Managing your graphic assets in libGDX

Usually, libGDX assets are located in the assets directory in the android module:

project_structure

You can just put every single image you want to use in your game into the assets folder, but this is a very bad idea. OpenGL bounds textures, which is relatively expensive (memory allocation). So the idea is to store many smaller images on a larger image, than load that bigger image once and use parts of it. LibGDX has a so called “TexturePacker” which is a command line application that packs many images on to larger images. The locations of the smaller images are stored and can easily references by their name without the file ending. Different algorithms are used for a very efficient texture packaging.

Either you run the TexturePacker via code or via script from and command line, like I did it, which works pretty well for me. Put your graphic assets into the tools/sprites directory and then execute the tools/texturepacker.sh script (Linux / Mac OS X) or the tools/texturepacker.cmd script (Windows). The results are put in the android/assets folder.

Leave a Reply

Your email address will not be published. Required fields are marked *

five × one =

This site uses Akismet to reduce spam. Learn how your comment data is processed.