Libgdx Texture Packer [repack] -

// Don't forget to dispose! atlas.dispose(); The texture packer uses your folder structure to create region names.

Run this main method every time you change your assets. Once you have player.atlas and player.png in your assets folder, load and use them:

// 1. Load the atlas TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("player.atlas")); // 2. Get a single region (a sprite from the atlas) TextureRegion playerStand = atlas.findRegion("player_idle_01"); libgdx texture packer

Write a simple Java class or Gradle task to run the packer:

Add the dependency to your core/build.gradle : // Don't forget to dispose

dependencies // ... your other dependencies compileOnly "com.badlogicgames.gdx:gdx-tools:$gdxVersion"

import com.badlogic.gdx.tools.texturepacker.TexturePacker; public class AssetPacker public static void main(String[] args) TexturePacker.Settings settings = new TexturePacker.Settings(); settings.pot = true; settings.paddingX = 2; settings.paddingY = 2; settings.edgePadding = true; settings.stripWhitespace = true; settings.filterMin = TexturePacker.Settings.TextureFilter.Nearest; settings.filterMag = TexturePacker.Settings.TextureFilter.Nearest; Once you have player

// (input directory, output directory, atlas file name) TexturePacker.process(settings, "raw-assets/player", "android/assets/", "player");