app version for Mac OS X, you need to open it as a folder and find it at GDXTexturePacker.app\Contents\MacOS\config.json) to change the default memory maximum if you need more. You can edit the config.json file included with the platform-specific binaries (it's inside the. jar) on the Releases tab default to 1 gigabyte of RAM used for this program, which should be enough for at least 50 1024x1024 pages of textures. Exceptionally large amounts of images may use all the memory the JVM has available to it, which has a default that is rather tiny. If you are packing a large number of images, you may want to include a pack.json file with at least the option fast: true set and possibly the stripWhitespaceX and stripWhitespaceY options set to true as well, though the last two require additional code to work properly. Check the output directory you specified and see how well your images compressed! Troubleshooting It could also crash if there are far too many images for your computer to handle, which also can occur with libGDX's command-line TexturePacker. The blue "Processing." message to the right should change to a green "SUCCESS!" once things are done, or possibly a red "PROCESSING FAILURE." if something went wrong. Once you've entered at least the top two fields, click the bottom "Pack Textures!" button and wait for it to complete, which may take a while on larger sets of images. The format for pack.json files is a simplified version of JSON (so it can be edited with any text editor), and is described here. You can optionally include a file with the name "pack.json" in each folder with additional configuration. Running the jar or other executable presents you with a simple GUI: select the input folder that contains the images to pack, select the output folder (preferably an empty one, to avoid potentially overwriting something), and prefix for the atlas and texture pages (the default, "pack", will result in "pack.atlas" and "pack.png" as the first files it generates entering "monsters" will make "monsters.atlas" and "monsters.png"). jar download unless you don't have Java installed. There are several downloads on the Releases tab of this project you probably want the. This is an attempt to change that, using libGDX's code as a base. There's a commercial packer with a GUI and an older wrapper around libGDX's TexturePacker, but nothing recent that packs textures for libGDX has had both a GUI and a $0 price tag. Unfortunately for some developers, it isn't the easiest tool to use. LibGDX provides a very full-featured way to pack many images into one texture with its TexturePacker tool. A standalone version of libGDX's TexturePacker with a GUI The TexturePacker class is in the gdx-tools project. If you are using Scene2d Skins, you probably already use Skin Composer and can use its user-friendly interface to add your textures to the Skin’s atlas. If you prefer to pack your textures using a GUI, you can use Texture Packer GUI. It also uses brute force, packing with numerous heuristics at various sizes and then choosing the most efficient result. TexturePacker uses multiple packing algorithms but the most important is based on the maximal rectangles algorithm. It stores the locations of the smaller images so they are easily referenced by name in your application using the TextureAtlas class. libGDX has a TexturePacker class which is a command line application that packs many smaller images on to larger images. Binding the texture is relatively expensive, so it is ideal to store many smaller images on a larger image, bind the larger texture once, then draw portions of it many times. In OpenGL, a texture is bound, some drawing is done, another texture is bound, more drawing is done, etc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |