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