At the moment i use both in combination but i think in a wrong way:
public class Assets {
public static final AssetManager manager = new AssetManager();
public static final String player = "hero/hero.txt";
public static final String pogo = "enemy/pogopuschel.txt";
public static void load() {
manager.load(player, TextureAtlas.class);
manager.load(pogo, TextureAtlas.class);
}
public static void dispose() {
manager.dispose();
}
}
PlayScreen class
public PlayScreen(Main game) {
Assets.load();
Assets.manager.finishLoading();
atlas = Assets.manager.get(Assets.player, TextureAtlas.class); //Load only one Asset, how to load more?
}
Player class
public Player(PlayScreen screen) {
super(screen);
move_down = setAnimation(super.move_down, 32, 32, false);
move_up = setAnimation(super.move_up, 32, 32, false);
move_right = setAnimation(super.move_right, 32, 32, false);
move_left = setAnimation(super.move_right, 32, 32, true);
stand_down = new TextureRegion(screen.getAtlas().findRegion(super.stand_down), 0, 0, 32, 32);
stand_up = new TextureRegion(screen.getAtlas().findRegion(super.stand_up), 0, 0, 32, 32);
stand_right = new TextureRegion(screen.getAtlas().findRegion(super.stand_right), 0, 0, 32, 32);
stand_left = new TextureRegion(screen.getAtlas().findRegion(super.stand_right), 0, 0, 32, 32);
stand_left.flip(true, false);
}
I have a lot of sprites maybe over 2000 can i only use TexturePacker and TextureAtlas? Or should i use the Assetmanager in combination?
How can i give the TextureAtlas all Assets from the AssetManager?