Java 类com.badlogic.gdx.assets.loaders.SkinLoader 实例源码

项目:ProjektGG    文件:LoadingScreen.java   
private void onFinishedLoading() {
    BitmapFont main19Font = assetManager.get(MAIN_FONT_19_PATH());
    BitmapFont main22Font = assetManager.get(MAIN_FONT_22_PATH());
    BitmapFont letter20Font = assetManager.get(LETTER_FONT_20_PATH());
    BitmapFont handwritten20Font = assetManager
            .get(HANDWRITTEN_FONT_20_PATH());

    ObjectMap<String, Object> fontMap = new ObjectMap<String, Object>();
    fontMap.put("main-19", main19Font);
    fontMap.put("main-22", main22Font);
    fontMap.put("letter-20", letter20Font);
    fontMap.put("handwritten-20", handwritten20Font);
    assetManager.load(SKIN_PATH, Skin.class,
            new SkinLoader.SkinParameter(SKIN_TEXTURE_ATLAS_PATH, fontMap));
    assetManager.finishLoadingAsset(SKIN_PATH);

    // game.setUISkin(assetManager.get(SKIN_PATH));
    VisUI.load();
    game.setUISkin(VisUI.getSkin());

    // Notify loaded screens
    game.getScreen("serverBrowser").finishLoading();

    game.pushScreen("mainMenu");
}
项目:gdxjam-ugg    文件:LoaderUtils.java   
public void init() {

        /*************** ASSET MANAGER ********************/
        assetManager.load("data/gui.json", Skin.class, new SkinLoader.SkinParameter(guiAtlas));
        assetManager.load(gameAtlas, TextureAtlas.class);
        assetManager.load("data/mental-space", I18NBundle.class, new I18NBundleLoader.I18NBundleParameter(java.util.Locale.getDefault()));

        /**************** Load Sounds and music *******************/
        SoundManager.getInstance().loadBasicSounds();
        MusicManager.getInstance().init(this);
        MusicManager.getInstance().loadBasics();

        /**************** Finish ******************/
        this.finishLoading();

        this.loadParticles();
    }
项目:libgdxcn    文件:AssetManager.java   
/** Creates a new AssetManager with all default loaders. */
public AssetManager (FileHandleResolver resolver) {
    setLoader(BitmapFont.class, new BitmapFontLoader(resolver));
    setLoader(Music.class, new MusicLoader(resolver));
    setLoader(Pixmap.class, new PixmapLoader(resolver));
    setLoader(Sound.class, new SoundLoader(resolver));
    setLoader(TextureAtlas.class, new TextureAtlasLoader(resolver));
    setLoader(Texture.class, new TextureLoader(resolver));
    setLoader(Skin.class, new SkinLoader(resolver));
    setLoader(ParticleEffect.class, new ParticleEffectLoader(resolver));
    setLoader(PolygonRegion.class, new PolygonRegionLoader(resolver));
    setLoader(I18NBundle.class, new I18NBundleLoader(resolver));
    setLoader(Model.class, ".g3dj", new G3dModelLoader(new JsonReader(), resolver));
    setLoader(Model.class, ".g3db", new G3dModelLoader(new UBJsonReader(), resolver));
    setLoader(Model.class, ".obj", new ObjLoader(resolver));
    executor = new AsyncExecutor(1);
}
项目:c2d-engine    文件:RuleSkin.java   
@Override
public boolean match(FileHandle file) {
    //find the same name of the skin and subfix is png
    String texturePath = file.parent().path().replace("\\", "/");
    if(texturePath.endsWith("/")){
        texturePath += file.nameWithoutExtension()+".atlas";
    }else{
        texturePath += ("/"+file.nameWithoutExtension()+".atlas");
    }
    boolean result = file.extension().equals("json") && file.path().contains("skin");
    if(result) Engine.getAssetManager().load(file.path().replace("\\", "/"),Skin.class,new SkinLoader.SkinParameter(texturePath));
    return  result;
}
项目:sokobug    文件:TitleScreen.java   
public TitleScreen(Sokobug myGame) {
    game = myGame;
    readyToSkip = false;

    TextureParameter param = new TextureParameter();
    param.minFilter = TextureFilter.Linear;
    param.magFilter = TextureFilter.Linear;

    game.assetManager.load(Resources.BACKGROUNDS_TITLE.getPath(), Texture.class, param);
    game.assetManager.finishLoading();

    titleImage = new Sprite(game.assetManager.get(Resources.BACKGROUNDS_TITLE.getPath(), Texture.class));
    titleImage.setPosition(0.f, 0.f);
    pasedTimeCounter = 0.0f;
    titleScreenMinDuration = 3.5f;

    game.assetManager.load(Resources.FONTS_JAPONESA24.getPath(), BitmapFont.class);
    game.assetManager.load(Resources.FONTS_JAPONESA32.getPath(), BitmapFont.class);
    game.assetManager.load(Resources.FONTS_JAPONESA60.getPath(), BitmapFont.class);
    game.assetManager.load(Resources.FONTS_JAPONESA120.getPath(), BitmapFont.class);

    game.assetManager.load(Resources.UI_BUTTONS_PACK.getPath(), TextureAtlas.class);
    game.assetManager.load(Resources.UI_BUTTONS_JSON.getPath(), Skin.class, new SkinLoader.SkinParameter(
            Resources.UI_BUTTONS_PACK.getPath()));

    game.assetManager.load(Resources.BACKGROUNDS_MENU.getPath(), Texture.class, param);
    game.assetManager.load(Resources.BACKGROUNDS_POTATOES.getPath(), Texture.class, param);

    game.assetManager.load(Resources.ANIMATIONS_PACK_BUG.getPath(), TextureAtlas.class);
    game.assetManager.load(Resources.ANIMATIONS_PACK_SPOTGLOW.getPath(), TextureAtlas.class);
    game.assetManager.load(Resources.ANIMATIONS_PACK_VICTORYGLOW.getPath(), TextureAtlas.class);

    game.assetManager.load(Resources.TILES_SARCOPHAGUS.getPath(), Texture.class, param);
    game.assetManager.load(Resources.TILES_WALL.getPath(), Texture.class, param);
    game.assetManager.load(Resources.TILES_FREE.getPath(), Texture.class, param);
    game.assetManager.load(Resources.TILES_SPOTON.getPath(), Texture.class, param);
    game.assetManager.load(Resources.TILES_SPOTOFF.getPath(), Texture.class, param);

    game.assetManager.load(Resources.METAITEMS_TOPBAR.getPath(), Texture.class, param);
    game.assetManager.load(Resources.METAITEMS_PAD.getPath(), Texture.class, param);
    game.assetManager.load(Resources.METAITEMS_VICTORYWING.getPath(), Texture.class, param);

    game.assetManager.load(Resources.LABELS_FINISH.getPath(), Texture.class, param);    

    game.assetManager.load(Resources.SOUND_BUGMOVE.getPath(), Sound.class);
    game.assetManager.load(Resources.SOUND_BUTTONCLICK.getPath(), Sound.class);
    game.assetManager.load(Resources.SOUND_SARCOPHAGUSMOVE.getPath(), Sound.class);
    game.assetManager.load(Resources.SOUND_VICTORY.getPath(), Sound.class);
}