當前位置: 首頁>>代碼示例>>Java>>正文


Java AssetManager.finishLoadingAsset方法代碼示例

本文整理匯總了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);
}
 
開發者ID:opensourcegamedev,項目名稱:SpaceChaos,代碼行數:34,代碼來源:CreditsScreen.java

示例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();
}
 
開發者ID:opensourcegamedev,項目名稱:SpaceChaos,代碼行數:22,代碼來源:HUDOverlayScreen.java

示例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);
}
 
開發者ID:opensourcegamedev,項目名稱:SpaceChaos,代碼行數:13,代碼來源:LoadingScreen.java

示例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);
}
 
開發者ID:opensourcegamedev,項目名稱:SpaceChaos,代碼行數:10,代碼來源:SplashscreenScreen.java


注:本文中的com.badlogic.gdx.assets.AssetManager.finishLoadingAsset方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。