raw-assets/player/ ├── idle/ │ ├── frame1.png │ └── frame2.png └── run/ ├── run01.png └── run02.png You can access atlas.findRegion("idle/frame1") or atlas.findRegions("run") .
// (input directory, output directory, atlas file name) TexturePacker.process(settings, "raw-assets/player", "android/assets/", "player"); libgdx texture packer
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: raw-assets/player/ ├── idle/ │ ├── frame1
Add the dependency to your core/build.gradle : atlas file name) TexturePacker.process(settings
// 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");
raw-assets/player/ ├── idle/ │ ├── frame1.png │ └── frame2.png └── run/ ├── run01.png └── run02.png You can access atlas.findRegion("idle/frame1") or atlas.findRegions("run") .
// (input directory, output directory, atlas file name) TexturePacker.process(settings, "raw-assets/player", "android/assets/", "player");
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:
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");