本文整理匯總了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);
}