示例#1
0
  public void init() {
    assetManager.load(ATLAS_UI, TextureAtlas.class);
    assetManager.load(SKIN_UI, Skin.class);

    assetManager.load(ATLAS_UI_BUTTONS, TextureAtlas.class);
    // assetManager.load(SKIN_UI_BUTTONS, Skin.class);
    // TODO: load game graphics atlas here
    assetManager.finishLoading();

    skinUI = assetManager.get(SKIN_UI);
    textureAtlasUI = assetManager.get(ATLAS_UI);

    textureAtlasButtons = assetManager.get(ATLAS_UI_BUTTONS, TextureAtlas.class);

    // Stopped loading the skinButton skin in the Assetmanager to generate font size on the fly
    skinButton = new Skin();
    skinButton.add(
        "default-font",
        this.fonts.getLemonMilk(Helpers.getFontSize(20, 720.0f, Gdx.graphics.getHeight())));
    skinButton.addRegions(new TextureAtlas(Gdx.files.internal("ui/9patch_buttons.atlas")));
    skinButton.load(Gdx.files.internal("ui/9patch_buttons.json"));

    // this.assetManager = assetManager;

    // assetManager.load(Constants.ATLAS_GAME, TextureAtlas.class);
    // assetManager.finishLoading();
    // TextureAtlas atlas = assetManager.get(Constants.ATLAS_GAME);

    // initAssets(atlas);
  }