本文整理汇总了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();
}
示例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>();
}
示例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);
}