Libgdx Texture Packer |work| -
// (input directory, output directory, atlas file name) TexturePacker.process(settings, "raw-assets/player", "android/assets/", "player");
Write a simple Java class or Gradle task to run the packer:
raw-assets/player/ ├── idle/ │ ├── frame1.png │ └── frame2.png └── run/ ├── run01.png └── run02.png You can access atlas.findRegion("idle/frame1") or atlas.findRegions("run") . libgdx texture packer
Add the dependency to your core/build.gradle :
// 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"); // (input directory, output directory, atlas file name)
// 3. Or get an animated region Animation<TextureRegion> walkAnimation = new Animation<>(0.1f, atlas.findRegions("player_walk"), Animation.PlayMode.LOOP);
dependencies // ... your other dependencies compileOnly "com.badlogicgames.gdx:gdx-tools:$gdxVersion" // (input directory
// 4. Or create a full Sprite (with color, rotation, etc.) Sprite playerSprite = atlas.createSprite("player_jump");