当前位置: 首页>>代码示例>>Java>>正文


Java AssetManager.load方法代码示例

本文整理汇总了Java中com.badlogic.gdx.assets.AssetManager.load方法的典型用法代码示例。如果您正苦于以下问题:Java AssetManager.load方法的具体用法?Java AssetManager.load怎么用?Java AssetManager.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.assets.AssetManager的用法示例。


在下文中一共展示了AssetManager.load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: AssetsButton

import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public AssetsButton() {
    manager = new AssetManager();
    manager.load(NameFiles.buttonLeft, Texture.class);
    manager.load(NameFiles.buttonRight,Texture.class);
    manager.load(NameFiles.buttontwoLeft,Texture.class);
    manager.load(NameFiles.button_describe,Texture.class);
    manager.load(NameFiles.logoEnklave,Texture.class);
    manager.load(NameFiles.buttonBack1,Texture.class);
    manager.load(NameFiles.buttonShowEnklave,Texture.class);
    manager.load(NameFiles.imageInformationEnklave,Texture.class);
    manager.load(NameFiles.buttonTabCraft,Texture.class);
    manager.load(NameFiles.imageFactionArhitects,Texture.class);
    manager.load(NameFiles.backDeployBricks,Texture.class);
    manager.load(NameFiles.buttonMinusCraft,Texture.class);
    manager.load(NameFiles.buttonPlusCraft,Texture.class);
    manager.load(NameFiles.cursorTextField,Texture.class);
    manager.load(NameFiles.logoEdenites3D, Model.class);
    manager.load(NameFiles.logoArhitects3D,Model.class);
    manager.load(NameFiles.logoPrometheans3D,Model.class);
    manager.load(NameFiles.disaibleButton,Texture.class);
    manager.load(NameFiles.buttonStartCombat,Texture.class);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:23,代码来源:AssetsButton.java

示例3: loadAssets

import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
private void loadAssets() {
    InternalFileHandleResolver fileHandler = new InternalFileHandleResolver();
    assetManager = new AssetManager(fileHandler);
    assetManager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(fileHandler));

    assetManager.load(SKIN_PATH, Skin.class);
    assetManager.load(MASTER_PATH, TextureAtlas.class);
    assetManager.load(FONT_NORMAL_PATH, FreeTypeFontGenerator.class);
    assetManager.load(FONT_BOLD_PATH, FreeTypeFontGenerator.class);
    assetManager.load(MUSIC_PATH, Music.class);
    assetManager.load(MAIN_MENU_MUSIC_PATH, Music.class);
    assetManager.load(GOOD_PATH, Sound.class);
    assetManager.load(HALF_PATH, Sound.class);
    assetManager.load(BAD_PATH, Sound.class);
    assetManager.finishLoading();
}
 
开发者ID:DurianHLN,项目名称:Polymorph,代码行数:17,代码来源:Polymorph.java

示例4: AssetsRooms

import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public AssetsRooms() {
    manager = new AssetManager();
    manager.load(NameFiles.topenklaveimage,Texture.class);
    manager.load(NameFiles.noselectRooms,Texture.class);
    manager.load(NameFiles.selectroombottom,Texture.class);
    manager.load(NameFiles.selectroomleft,Texture.class);
    manager.load(NameFiles.selectroomright,Texture.class);
    manager.load(NameFiles.txtSelectRoom,Texture.class);
    manager.load(NameFiles.imageArrowBottom,Texture.class);
    manager.load(NameFiles.imageArrowRight,Texture.class);
    manager.load(NameFiles.imagePulse,Texture.class);
    manager.load(NameFiles.extensionImgBackground,Texture.class);
    manager.load(NameFiles.borderImageBlue,Texture.class);
    manager.load(NameFiles.borderUpdown,Texture.class);
    manager.load(NameFiles.progressbarcircular,Texture.class);
    manager.load(NameFiles.imageBarrack,Texture.class);
    manager.load(NameFiles.imageCommCenter,Texture.class);
    manager.load(NameFiles.imageLaboratory,Texture.class);
    manager.load(NameFiles.frameEnk,Texture.class);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:21,代码来源:AssetsRooms.java

示例5: AssetsCrafting

import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public AssetsCrafting() {
        manager = new AssetManager();
//        manager.load(NameFiles.craftingbuttonNext,Texture.class);
//        manager.load(NameFiles.craftingbuttonnextchek,Texture.class);
//        manager.load(NameFiles.craftingbuttonback,Texture.class);
//        manager.load(NameFiles.craftingbuttonbackcheck,Texture.class);
//        manager.load(NameFiles.craftingimgnext,Texture.class);
//        manager.load(NameFiles.craftingimgnextcheck,Texture.class);
//        manager.load(NameFiles.craftingimgback,Texture.class);
//        manager.load(NameFiles.craftingimgbackcheck,Texture.class);
        manager.load(NameFiles.suport3D,Model.class);
        manager.load(NameFiles.scrapModel3D, Model.class);
        manager.load(NameFiles.cellModel3D,Model.class);
        manager.load(NameFiles.brickModel3D,Model.class);
        manager.load(NameFiles.backgroundCrafting,Texture.class);
        manager.load(NameFiles.backgroundModel3d,Texture.class);
        manager.load(NameFiles.buttonCraft,Texture.class);
        manager.load(NameFiles.backgroundbuttoncreft,Texture.class);
        manager.load(NameFiles.arrowcrafting,Texture.class);
    }
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:21,代码来源:AssetsCrafting.java

示例6: CutsceneStoneAge

import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public CutsceneStoneAge(MyGdxGame myGdxGame) {
	this.myGdxGame = myGdxGame;
	batch = myGdxGame.batch;
	sr = myGdxGame.sr;
	viewport = myGdxGame.viewport;
	camera = myGdxGame.camera;
	font = myGdxGame.font;

	particles = new Particles();

	bg = new Sprite(new Texture("sprites/orange.png"));
	girl = new Sprite(new Texture("sprites/girl.png"));
	stone = new Sprite(new Texture("sprites/stein_angemalt.png"));
	hominideSitzend = new Sprite(new Texture("sprites/hominide_sitzend.png"));
	hominideDuckend = new Sprite(new Texture("sprites/hominide_duckend.png"));
	hominideStehend = new Sprite(new Texture("sprites/hominide_stehend.png"));

	assetManager = new AssetManager();
	assetManager.load("music/tusch.mp3", Sound.class);
	assetManager.load("music/5_steinzeit.mp3", Music.class);

	assetManager.finishLoading();

	tusch = assetManager.get("music/tusch.mp3", Sound.class);
	musicStoneAge = assetManager.get("music/5_steinzeit.mp3", Music.class);
}
 
开发者ID:cdetamble,项目名称:nomoore,代码行数:27,代码来源:CutsceneStoneAge.java

示例7: LogoScreen

import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public LogoScreen(SpriteBatch batch, ShapeRenderer shapeRenderer, FitViewport viewport, OrthographicCamera camera) {
    this.batch = batch;
    this.shapeRenderer = shapeRenderer;
    this.viewport = viewport;
    this.camera = camera;

    spriteThere = new Sprite(new Texture("there.png"));
    spriteFactory = new Sprite(new Texture("factory.png"));
    spriteLibGdxLogo = new Sprite(new Texture("libgdx.png"));

    AssetManager am = JewelThief.getInstance().getAssetManager();
    am.load("audio/sounds/keyboard.ogg", Sound.class);
    am.load("audio/sounds/keyboard_go_back.ogg", Sound.class);
    am.load("audio/sounds/re.ogg", Sound.class);
    am.load("audio/sounds/libgdx.ogg", Music.class);
    am.finishLoading();

    soundTypeTheRefactory = am.get("audio/sounds/keyboard.ogg", Sound.class);
    soundGoBackOnKeyboard = am.get("audio/sounds/keyboard_go_back.ogg", Sound.class);
    soundTypeRe = am.get("audio/sounds/re.ogg", Sound.class);
    musicLibGdxJingle = am.get("audio/sounds/libgdx.ogg", Music.class);

    resetAnimation();
}
 
开发者ID:cdetamble,项目名称:jewelthief,代码行数:25,代码来源:LogoScreen.java

示例8: create

import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
/** Инициализация и загрузка ресурсов */
@Override
public void create () {
	// Размеры экрана
	scrHalfWidth = Gdx.graphics.getWidth() / 2;
	scrHeight = Gdx.graphics.getHeight();

	// Загрузка модели из файла
	modelBatch = new ModelBatch();
	assets = new  AssetManager();
	assets.load("room.g3db", Model.class);
	assets.finishLoading();
	Model roomModel = assets.get("room.g3db");
	roomInstance = new ModelInstance(roomModel);

	// Создание камеры (fov, parallax, near, far) и установка позиции
	vrCamera = new VRCamera(90, 0.4f, 0.1f, 30f);
	vrCamera.setPosition(-1.7f, 3f, 3f);

	// Разрешаем коррекцию дрифта при помощи компаса
	vrSensorManager.useDriftCorrection(true);
}
 
开发者ID:SinuXVR,项目名称:GdxVR-Sample-1,代码行数:23,代码来源:GdxVR.java

示例9: AssetsMainMenu

import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public AssetsMainMenu() {
    manager = new AssetManager();
    manager.load(Presets.TEXTURE_UI + "background.png", Texture.class);
    manager.load(Presets.TEXTURE_UI + "icon.png", Texture.class);     
    manager.load(Presets.SOUNDS + "wall_hit.ogg", Sound.class);
    manager.load(Presets.SOUNDS + "bullet_dead.ogg", Sound.class);
    manager.load(Presets.TEXTURE_UI + DEFAULT_FONT, BitmapFont.class);
    manager.finishLoading();

    mainMenuTexture = manager.get(Presets.TEXTURE_UI + "background.png");
    selectionIcon = new Sprite((Texture) manager.get(Presets.TEXTURE_UI
            + "icon.png"));     

    defaultFont = manager.get(Presets.TEXTURE_UI + DEFAULT_FONT);
    selectionSound = manager.get(Presets.SOUNDS + "bullet_dead.ogg");
    selectSound = manager.get(Presets.SOUNDS + "wall_hit.ogg");
    postLoading();
}
 
开发者ID:jh62,项目名称:Battle-City-Multiplayer,代码行数:19,代码来源:AssetsMainMenu.java

示例10: load

import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
@Override
public void load(AssetManager am) {
	unload(am);
	if (storySequence != null) {
		for (AudioTrack<?> music : storySequence.getMusic()) {
			music.gatherAssets(loadedAssets);
		}
		for (StoryPage page : storySequence.getPages()) {
			if (page.isApplicable()) {
				loadedAssets.put(page.getImage(), Texture.class);
			}
		}
	}
	
	for (Entry<String, Class<?>> entry : loadedAssets) {
		am.load(entry.key, entry.value);
	}
}
 
开发者ID:mganzarcik,项目名称:fabulae,代码行数:19,代码来源:StorySequencePanelLoader.java

示例11: AssetsFadeInActions

import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public AssetsFadeInActions() {
    manager = new AssetManager();
    manager.load(NameFiles.btnfadeaction, Texture.class);
    manager.load(NameFiles.queuebackFadein,Texture.class);
    manager.load(NameFiles.btnStopaction,Texture.class);
    manager.load(NameFiles.iconfinishaction,Texture.class);
    manager.load(NameFiles.iconcurrentaction,Texture.class);
    manager.load(NameFiles.iconnextaction,Texture.class);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:10,代码来源:AssetsFadeInActions.java

示例12: 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();
}
 
开发者ID:davyjoneswang,项目名称:libgdx-learnlib,代码行数:38,代码来源:Assets.java

示例13: 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

示例14: 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

示例15: AssetsScreenChat

import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public AssetsScreenChat() {
    manager = new AssetManager();
    manager.load(NameFiles.backgroundchat,Texture.class);
    manager.load(NameFiles.backgroundchatbottom,Texture.class);
    manager.load(NameFiles.backgroundchatmiddle,Texture.class);
    manager.load(NameFiles.backgroundchattop,Texture.class);
    manager.load(NameFiles.btnchatfadein,Texture.class);
    manager.load(NameFiles.btnchatfadeout,Texture.class);
    manager.load(NameFiles.btnchatsend,Texture.class);
    manager.load(NameFiles.btnchattabmenu,Texture.class);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:12,代码来源:AssetsScreenChat.java


注:本文中的com.badlogic.gdx.assets.AssetManager.load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。