当前位置: 首页>>代码示例>>Java>>正文


Java AssetManager.setErrorListener方法代码示例

本文整理汇总了Java中com.badlogic.gdx.assets.AssetManager.setErrorListener方法的典型用法代码示例。如果您正苦于以下问题:Java AssetManager.setErrorListener方法的具体用法?Java AssetManager.setErrorListener怎么用?Java AssetManager.setErrorListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.assets.AssetManager的用法示例。


在下文中一共展示了AssetManager.setErrorListener方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public void init(AssetManager assetManager) {
    this.assetManager = assetManager;
    assetManager.setErrorListener(this);
    assetManager.load(TEXTURE_ATLAS_OBJECTS, TextureAtlas.class);
    // load sounds
    assetManager.load("sounds/jump.wav", Sound.class);
    assetManager.load("sounds/jump_with_feather.wav", Sound.class);
    assetManager.load("sounds/pickup_coin.wav", Sound.class);
    assetManager.load("sounds/pickup_feather.wav", Sound.class);
    assetManager.load("sounds/live_lost.wav", Sound.class);
    // load music
    assetManager.load("music/hair.ogg", Music.class);
    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(TEXTURE_ATLAS_OBJECTS);

    //激活平滑文理过度
    for (Texture t : atlas.getTextures()) {
        t.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
    }

    //创建游戏资源对象
    bunny = new AssetBunny(atlas);
    rock = new AssetRock(atlas);
    goldCoin = new AssetGoldCoin(atlas);
    feather = new AssetFeather(atlas);
    levelDecoration = new AssetLevelDecoration(atlas);
    sounds = new AssetSounds(assetManager);
    music = new AssetMusic(assetManager);

    fonts = new AssetFonts();
}
 
开发者ID:davyjoneswang,项目名称:libgdx-learnlib,代码行数:38,代码来源:Assets.java

示例2: LoaderUtils

import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public LoaderUtils() {
    resolver = new ResolutionFileResolver(new InternalFileHandleResolver(), resolutions);
    assetManager = new AssetManager(resolver);
    assetManager.setErrorListener(this);
    Texture.setAssetManager(assetManager);
    assetManager.setLoader(I18NBundle.class, new I18NBundleLoader(resolver));

    GUIConfig.initializeValues(resolutions);

    this.atlas = null;
    this.regions = new ObjectMap<String, AtlasRegion>();

}
 
开发者ID:unlimitedggames,项目名称:gdxjam-ugg,代码行数:14,代码来源:LoaderUtils.java

示例3: init

import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public void init(Nhg nhg) {
    this.nhg = nhg;
    fsm = new DefaultStateMachine<>(this, AssetsStates.IDLE);

    assetManager = new AssetManager();
    syncAssetManager = new AssetManager();

    FileHandleResolver resolver = assetManager.getFileHandleResolver();
    FileHandleResolver syncResolver = syncAssetManager.getFileHandleResolver();

    assetManager.setLoader(Scene.class, new SceneLoader(nhg, resolver));
    assetManager.setLoader(InputProxy.class, new InputLoader(resolver));
    assetManager.setLoader(JsonValue.class, new JsonLoader(resolver));
    assetManager.setLoader(HDRData2.class, new HDRLoader(resolver));
    assetManager.setLoader(Model.class, ".g3db", new NhgG3dModelLoader(this,
            new UBJsonReader(), resolver));

    syncAssetManager.setLoader(Scene.class, new SceneLoader(nhg, syncResolver));
    syncAssetManager.setLoader(InputProxy.class, new InputLoader(syncResolver));
    syncAssetManager.setLoader(JsonValue.class, new JsonLoader(syncResolver));
    syncAssetManager.setLoader(HDRData2.class, new HDRLoader(syncResolver));
    syncAssetManager.setLoader(Model.class, ".g3db", new NhgG3dModelLoader(this,
            new UBJsonReader(), syncResolver));

    assetManager.setErrorListener(this);
    syncAssetManager.setErrorListener(this);

    assetQueue = new Array<>();
    assetCache = new ArrayMap<>();

    Texture.setAssetManager(assetManager);
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:33,代码来源:Assets.java


注:本文中的com.badlogic.gdx.assets.AssetManager.setErrorListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。