Example usage for com.badlogic.gdx.assets AssetManager getAssetNames

List of usage examples for com.badlogic.gdx.assets AssetManager getAssetNames

Introduction

In this page you can find the example usage for com.badlogic.gdx.assets AssetManager getAssetNames.

Prototype

public synchronized Array<String> getAssetNames() 

Source Link

Usage

From source file:com.alma42.mapgen.game.Assets.java

License:Apache License

public void init(final AssetManager assetManager) {
    this.assetManager = assetManager;
    // set asset manager error handler
    assetManager.setErrorListener(this);
    // load texture atlas
    assetManager.load(Constants.TEXTURE_ATLAS_OBJECTS, TextureAtlas.class);
    // start loading assets and wait until finished
    assetManager.finishLoading();//w w  w.  ja va2 s. c  o m

    Gdx.app.debug(TAG, "# of assets loaded: " + assetManager.getAssetNames().size);
    for (final String a : assetManager.getAssetNames()) {
        Gdx.app.debug(TAG, "asset: " + a);
    }

    final TextureAtlas atlas = assetManager.get(Constants.TEXTURE_ATLAS_OBJECTS);

    // enable texture filtering for pixel smoothing
    for (final Texture t : atlas.getTextures()) {
        t.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    }

    // create game resource objects
    this.bunny = new AssetBunny(atlas);
    this.rock = new AssetRock(atlas);
    this.goldCoin = new AssetGoldCoin(atlas);
    this.feather = new AssetFeather(atlas);
    this.levelDecoration = new AssetLevelDecoration(atlas);
}

From source file:com.mrandmrsjian.freakingsum.Assets.java

License:Apache License

public void init(AssetManager assetManager) {
    this.assetManager = assetManager;
    // set asset manager error handler
    assetManager.setErrorListener(this);
    // load texture atlas
    assetManager.load("images.pack", TextureAtlas.class);
    // load sounds

    // load music

    // start loading assets and wait until finished
    assetManager.finishLoading();//  w  w w . j  a v a2  s  .  c o  m

    Gdx.app.debug(TAG, "# of assets loaded: " + assetManager.getAssetNames().size);
    for (String a : assetManager.getAssetNames()) {
        Gdx.app.debug(TAG, "asset: " + a);
    }

    fonts = new AssetFonts();
    atlas = assetManager.get("images.pack");

    // enable texture filtering for pixel smoothing
    for (Texture t : atlas.getTextures()) {
        t.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    }
}

From source file:com.ntr.prototype.game.Assets.java

public void init(AssetManager assetManager) {
    this.assetManager = assetManager;

    assetManager.setErrorListener(this);

    assetManager.load(Constants.ATLAS_OBJECT, TextureAtlas.class);
    //not completed
    assetManager.finishLoading();//  w  w  w  .j ava2s.  c  o m

    Gdx.app.debug(TAG, "# of assets loaded: " + assetManager.getAssetNames().size);
    for (String a : assetManager.getAssetNames()) {
        Gdx.app.debug(TAG, "assets : " + a);
    }

    TextureAtlas atlas = assetManager.get(Constants.ATLAS_OBJECT);

    for (Texture t : atlas.getTextures()) {
        t.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    }

    catcher = new AssetCatcher(atlas);
    decoration = new AssetDecoration(atlas);
    gas = new AssetGas(atlas);
    background = new AssetBackground(atlas);
}

From source file:com.packtpub.libgdx.canyonbunny.game.Assets.java

License:Apache License

public void init(AssetManager assetManager) {
    this.assetManager = assetManager;
    // set asset manager error handler
    assetManager.setErrorListener(this);
    // load texture atlas
    assetManager.load(Constants.TEXTURE_ATLAS_OBJECTS, TextureAtlas.class);
    // start loading assets and wait until finished
    assetManager.finishLoading();//  www.j  av  a  2s. c o m

    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(Constants.TEXTURE_ATLAS_OBJECTS);

    // enable texture filtering for pixel smoothing
    for (Texture t : atlas.getTextures()) {
        t.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    }

    // create game resource objects
    fonts = new AssetFonts();
    bunny = new AssetBunny(atlas);
    rock = new AssetRock(atlas);
    goldCoin = new AssetGoldCoin(atlas);
    feather = new AssetFeather(atlas);
    levelDecoration = new AssetLevelDecoration(atlas);
}

From source file:core.september.foundation.Assets.java

License:Apache License

public void init(AssetManager assetManager) {
    this.assetManager = assetManager;
    // set asset manager error handler
    assetManager.setErrorListener(this);
    // load texture atlas
    assetManager.load(Constants.TEXTURE_ATLAS_OBJECTS, TextureAtlas.class);
    assetManager.load("sounds/engine_on.wav", Sound.class);
    assetManager.load("sounds/level_switch.wav", Sound.class);
    assetManager.load("sounds/push_button.wav", Sound.class);
    assetManager.load("music/soundtrack.mp3", Music.class);
    // start loading assets and wait until finished
    assetManager.finishLoading();//  ww  w . ja  v  a 2s .c o m

    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(Constants.TEXTURE_ATLAS_OBJECTS);

    // enable texture filtering for pixel smoothing
    for (Texture t : atlas.getTextures()) {
        t.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    }

    // create game resource objects
    sounds = new AssetSounds(assetManager);
    assetMusic = new AssetMusic(assetManager);
    button = new AssetButton(atlas);
    background = new AssetBackground(atlas);
    countdown = new AssetCountDown(atlas);
    powerButton = new AssetPowerButton(atlas);
    led = new AssetLed(atlas);
    assetUi = new AssetUi(atlas);
    knob = new AssetSoundKnob(atlas);
    assetHelp = new AssetHelp(atlas);
    assetSkin = new AssetSkin(atlas);
    fonts = new AssetFonts();

}

From source file:utils.Assets.java

License:Apache License

public void initGame(AssetManager assetManager) {
    this.assetManagerGame = assetManager;
    // set asset manager error handler
    assetManager.setErrorListener(this);
    // load texture atlas
    assetManager.load(Const.TEXTURE_ATLAS_GAME, TextureAtlas.class);
    // load sounds
    assetManager.load("mp3/jump.wav", Sound.class);
    assetManager.load("mp3/walk.wav", Sound.class);
    assetManager.load("mp3/l_booben.wav", Sound.class);
    assetManager.load("mp3/booben.wav", Sound.class);
    assetManager.load("mp3/musik.mp3", Music.class);

    //      assetManager.load("mp3/fall.mp3", Sound.class);
    //      assetManager.load("mp3/rocket.mp3", Sound.class);
    //      assetManager.load("mp3/rocketLong.mp3", Sound.class);
    //      assetManager.load("mp3/bonus.mp3", Sound.class);
    assetManager.finishLoading();// ww w .  j a va2s. c o  m

    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(Const.TEXTURE_ATLAS_GAME);

    // enable texture filtering for pixel smoothing
    for (Texture t : atlas.getTextures()) {
        t.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    }
    // create game resource objects
    fonts = new AssetFonts();
    animation = new AssetAnimations(atlas);
    gameElements = new AssetGameElements(atlas);
    sounds = new AssetSounds(assetManager);
    sounds.getGameSounds();
    music = new AssetMusic(assetManager);
}