Libgdx Texturepacker ●
// With custom settings TexturePacker.Settings settings = new TexturePacker.Settings(); settings.maxWidth = 1024; settings.maxHeight = 1024; settings.padding = 2; settings.duplicatePadding = true; settings.edgePadding = true; settings.bleed = true; settings.alias = true; settings.pot = true; // Power of two settings.filterMin = TextureFilter.Nearest; settings.filterMag = TextureFilter.Nearest; settings.format = ImageFormat.RGBA8888;
}
java -cp "gdx.jar:gdx-tools.jar" com.badlogic.gdx.tools.texturepacker.TexturePacker \ ./raw-images \ ./packed \ my-atlas \ maxWidth=1024 maxHeight=1024 padding=2 libgdx texturepacker
: Set up your assets to pack automatically. Skin Composer : Use packed textures to create beautiful UIs.
For tile-based games, TexturePacker offers a specific setting to combat "grid lines." // With custom settings TexturePacker
Using TexturePacker is relatively straightforward. Here's a step-by-step guide:
TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("my_sprites.atlas")); AtlasRegion playerSprite = atlas.findRegion("player_walk_01"); // In your render method: batch.begin(); batch.draw(playerSprite, x, y); batch.end(); Use code with caution. Here's a step-by-step guide: TextureAtlas atlas = new
The companion text file is the bridge between the image and the code.