Reputation: 31
Hi I have some problems with the texture atlas packer assetmanager from libgdx.... maybe someone had the same issue... I pack my textures in my desktop app like this ... which is running and the pack files are generated...
public class DesktopLauncher {
private static boolean rebuildAtlas = false;
private static boolean drawDebugOutline = true;
public static void main (String[] arg) {
if (rebuildAtlas) {
Settings settings = new Settings();
settings.maxWidth = 1024;
settings.maxHeight = 1024;
settings.duplicatePadding = false;
settings.debug = drawDebugOutline;
TexturePacker.process(settings, "asset_raw/images", "../android/assets/images", "ppack.pack");
}
in my assetloader class i load this or i try too ...
public void init (AssetManager assetManager) {
this.assetManager = assetManager;
// set asset manager error handler
assetManager.setErrorListener(this);
assetManager.load("../android/assets/images/ppack.pack",TextureAtlas.class);
// start loading assets and wait until finished
assetManager.finishLoading();
Gdx.app.debug(TAG, "# of assets loaded: "+ assetManager.getAssetNames().size);
for (String a : assetManager.getAssetNames())
Gdx.app.debug(TAG, "asset: " + a);
TextureAtlas atlas = assetManager.get(../android/assets/images/ppack.pack");
...
However i get the error :
com.mygdx.game.Assets: Couldn't load asset '../android/assets/images/ppack.pack'
But the file exist and has no strange upper lower or antoher strange symbol in its name
any suggestions ?
Upvotes: 3
Views: 786
Reputation: 31
solved it by setting the working directory to .../gdx/first; and loading the ppack.atlas and not the .pack
Upvotes: 0
Reputation: 1257
You shouldn't need
"../android/assets/"
remove this part. If you get the error again check your Working Directory under Run/Debug configurations (Android Studio) and specify your assets folder.
https://github.com/libgdx/libgdx/wiki/Managing-your-assets
Upvotes: -1