当前位置: 首页>>代码示例>>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;未经允许,请勿转载。