本文整理匯總了Java中com.badlogic.gdx.assets.AssetManager.finishLoadingAsset方法的典型用法代碼示例。如果您正苦於以下問題:Java AssetManager.finishLoadingAsset方法的具體用法?Java AssetManager.finishLoadingAsset怎麽用?Java AssetManager.finishLoadingAsset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.assets.AssetManager
的用法示例。
在下文中一共展示了AssetManager.finishLoadingAsset方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onInit
import com.badlogic.gdx.assets.AssetManager; //導入方法依賴的package包/類
@Override
protected void onInit(ScreenBasedGame game, AssetManager assetManager) {
// load assets
assetManager.load(MUSIC_PATH, Music.class);
assetManager.load(BACKGROUND_IMAGE_PATH, Texture.class);
assetManager.finishLoadingAsset(MUSIC_PATH);
assetManager.finishLoadingAsset(BACKGROUND_IMAGE_PATH);
// get assets
this.music = assetManager.get(MUSIC_PATH, Music.class);
this.bgTexture = assetManager.get(BACKGROUND_IMAGE_PATH, Texture.class);
// generate fonts
this.titleFont = BitmapFontFactory.createFont("./data/font/spartakus/SparTakus.ttf", 48, Color.WHITE,
Color.BLUE, 3);
// this.font2 =
// BitmapFontFactory.createFont("./data/font/spartakus/SparTakus.ttf",
// 48, Color.RED, Color.WHITE, 3);
this.font1 = BitmapFontFactory.createFont("./data/font/arial/arial.ttf", 18, Color.WHITE);
this.font2 = BitmapFontFactory.createFont("./data/font/arial/arial-bold.ttf", 24, Color.WHITE, Color.RED, 3);
// generate credits text array
try {
this.generateCreditLines();
} catch (IOException e) {
e.printStackTrace();
// TODO: remove this line and handle exception with exception window
System.exit(0);
}
Gdx.input.setInputProcessor(null);
}
示例2: onInit
import com.badlogic.gdx.assets.AssetManager; //導入方法依賴的package包/類
@Override
protected void onInit(ScreenBasedGame game, AssetManager assetManager) {
// generate fonts
this.font1 = BitmapFontFactory.createFont("./data/font/spartakus/SparTakus.ttf", 48, Color.WHITE, Color.BLUE,
3);
this.font2 = BitmapFontFactory.createFont("./data/font/spartakus/SparTakus.ttf", 48, Color.RED, Color.WHITE, 3);
// load & get assets
assetManager.load(TORPEDO_IMAGE_PATH, Texture.class);
assetManager.finishLoadingAsset(TORPEDO_IMAGE_PATH);
this.torpedoTexture = assetManager.get(TORPEDO_IMAGE_PATH, Texture.class);
// create new Head-Up-Display
this.hud = new HUD();
this.filledBar = new FilledBar(this.font1);
this.filledBar.setPosition(game.getViewportWidth() - 400, game.getViewportHeight() - 85);
this.filledBar.setDimension(155, 35);
this.hud.addWidget(this.filledBar);
this.shapeRenderer = new ShapeRenderer();
}
示例3: onInit
import com.badlogic.gdx.assets.AssetManager; //導入方法依賴的package包/類
@Override
protected void onInit(ScreenBasedGame game, AssetManager assetManager) {
assetManager.load(BAR_ORANGE_IMAGE_PATH, Texture.class);
assetManager.load(BAR_BLUE_IMAGE_PATH, Texture.class);
assetManager.load(SPACE_IMAGE_PATH, Texture.class);
assetManager.finishLoadingAsset(BAR_ORANGE_IMAGE_PATH);
assetManager.finishLoadingAsset(BAR_BLUE_IMAGE_PATH);
assetManager.finishLoadingAsset(SPACE_IMAGE_PATH);
this.orangeBarTexture = assetManager.get(BAR_ORANGE_IMAGE_PATH, Texture.class);
this.blueBarTexture = assetManager.get(BAR_BLUE_IMAGE_PATH, Texture.class);
this.bgTexture = assetManager.get(SPACE_IMAGE_PATH, Texture.class);
}
示例4: onInit
import com.badlogic.gdx.assets.AssetManager; //導入方法依賴的package包/類
@Override
protected void onInit(ScreenBasedGame game, AssetManager assetManager) {
assetManager.load(LOGO_IMAGE_PATH, Texture.class);
assetManager.load(SPACE_IMAGE_PATH, Texture.class);
assetManager.finishLoadingAsset(LOGO_IMAGE_PATH);
assetManager.finishLoadingAsset(SPACE_IMAGE_PATH);
this.logoTexture = assetManager.get(LOGO_IMAGE_PATH, Texture.class);
this.bgTexture = assetManager.get(SPACE_IMAGE_PATH, Texture.class);
}