本文整理匯總了Java中com.badlogic.gdx.assets.AssetManager.finishLoading方法的典型用法代碼示例。如果您正苦於以下問題:Java AssetManager.finishLoading方法的具體用法?Java AssetManager.finishLoading怎麽用?Java AssetManager.finishLoading使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.assets.AssetManager
的用法示例。
在下文中一共展示了AssetManager.finishLoading方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: EditorManager
import com.badlogic.gdx.assets.AssetManager; //導入方法依賴的package包/類
public EditorManager(){
FileChooser.setDefaultPrefsName("white-ui-editor");
FileChooser.setSaveLastDirectory(true);
events = new Array<>();
assetManager = new AssetManager();
assetManager.load("badlogic.jpg", Texture.class);
assetManager.load("icon/select.9.png",Texture.class);
assetManager.load("icon/align_left.png",Texture.class);
assetManager.load("icon/align_right.png",Texture.class);
assetManager.load("icon/align_center.png",Texture.class);
assetManager.load("icon/align_h_center.png",Texture.class);
assetManager.load("icon/align_bottom.png",Texture.class);
assetManager.load("icon/align_top.png",Texture.class);
assetManager.load("icon/label.png",Texture.class);
assetManager.load("icon/image.png",Texture.class);
assetManager.load("icon/group.png",Texture.class);
assetManager.load("icon/button.png",Texture.class);
assetManager.load("icon/checkbox.png",Texture.class);
assetManager.load("icon/textfield.png",Texture.class);
assetManager.finishLoading();
}
示例2: 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();
}
示例3: 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);
}
示例4: 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();
}
示例5: 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);
}
示例6: 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();
}
示例7: 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();
}
示例8: CutsceneMedieval
import com.badlogic.gdx.assets.AssetManager; //導入方法依賴的package包/類
public CutsceneMedieval(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/red.png"));
girl = new Sprite(new Texture("sprites/girl.png"));
king = new Sprite(new Texture("sprites/king.png"));
mother = new Sprite(new Texture("sprites/mother.png"));
girldBurned1 = new Sprite(new Texture("sprites/girl_burned1.png"));
girldBurned2 = new Sprite(new Texture("sprites/girl_burned2.png"));
girldBurned3 = new Sprite(new Texture("sprites/girl_burned3.png"));
girldBurned4 = new Sprite(new Texture("sprites/girl_burned4.png"));
assetManager = new AssetManager();
assetManager.load("music/tusch.mp3", Sound.class);
assetManager.load("music/iHaveBurned.mp3", Music.class);
assetManager.load("music/slap.mp3", Sound.class);
assetManager.load("music/4_mittelalter.mp3", Music.class);
assetManager.finishLoading();
slap = assetManager.get("music/slap.mp3", Sound.class);
tusch = assetManager.get("music/tusch.mp3", Sound.class);
mittelalter = assetManager.get("music/4_mittelalter.mp3", Music.class);
iHaveBurned = assetManager.get("music/iHaveBurned.mp3", Music.class);
}
示例9: CutsceneModernTimes
import com.badlogic.gdx.assets.AssetManager; //導入方法依賴的package包/類
public CutsceneModernTimes(MyGdxGame myGdxGame) {
this.myGdxGame = myGdxGame;
batch = myGdxGame.batch;
sr = myGdxGame.sr;
viewport = myGdxGame.viewport;
camera = myGdxGame.camera;
font = myGdxGame.font;
bg = new Sprite(new Texture("sprites/curscene1bg.png"));
girl = new Sprite(new Texture("sprites/girl.png"));
knife = new Sprite(new Texture("sprites/knife.png"));
human1 = new Sprite(new Texture("sprites/human1.png"));
human2 = new Sprite(new Texture("sprites/human2.png"));
girlStabbed1 = new Sprite(new Texture("sprites/girl_stabbed1.png"));
girlStabbed2 = new Sprite(new Texture("sprites/girl_stabbed2.png"));
girlStabbed3 = new Sprite(new Texture("sprites/girl_stabbed3.png"));
girlStabbed4 = new Sprite(new Texture("sprites/girl_stabbed4.png"));
assetManager = new AssetManager();
assetManager.load("music/1_iCutMyself.mp3", Music.class);
assetManager.load("music/2_dadFindsHer.mp3", Music.class);
assetManager.load("music/iHavePaintedTheStone.mp3", Music.class);
assetManager.load("music/knifeDrop.mp3", Sound.class);
assetManager.finishLoading();
iCutMyself = assetManager.get("music/1_iCutMyself.mp3", Music.class);
dadFindsHer = assetManager.get("music/2_dadFindsHer.mp3", Music.class);
iHavePaintedTheStone = assetManager.get("music/iHavePaintedTheStone.mp3", Music.class);
knifeDrop = assetManager.get("music/knifeDrop.mp3", Sound.class);
}
示例10: ScreenOutro
import com.badlogic.gdx.assets.AssetManager; //導入方法依賴的package包/類
public ScreenOutro(MyGdxGame myGdxGame) {
this.myGdxGame = myGdxGame;
batch = myGdxGame.batch;
viewport = myGdxGame.viewport;
camera = myGdxGame.camera;
font = myGdxGame.font;
assetManager = new AssetManager();
assetManager.load("music/6_theEnd.mp3", Music.class);
assetManager.finishLoading();
theEnd = assetManager.get("music/6_theEnd.mp3", Music.class);
}
示例11: loadAssets
import com.badlogic.gdx.assets.AssetManager; //導入方法依賴的package包/類
private void loadAssets() {
AssetManager manager = JewelThief.getInstance().getAssetManager();
manager.load("audio/sounds/collect.ogg", Sound.class);
manager.load("audio/sounds/coin.ogg", Sound.class);
manager.load("audio/sounds/applause.ogg", Sound.class);
manager.load("audio/sounds/one_blow_from_party_horn.ogg", Sound.class);
manager.finishLoading();
soundCollectJewel = manager.get("audio/sounds/collect.ogg", Sound.class);
soundOuch = manager.get("audio/sounds/coin.ogg", Sound.class);
soundApplause = manager.get("audio/sounds/applause.ogg", Sound.class);
soundLose = manager.get("audio/sounds/one_blow_from_party_horn.ogg", Sound.class);
}
示例12: loadSpriteSheet
import com.badlogic.gdx.assets.AssetManager; //導入方法依賴的package包/類
protected final TextureRegion[][] loadSpriteSheet(final String spriteSheetPath, final AssetManager assetManager,
final int frameWidth, final int frameHeight) {
if (!assetManager.isLoaded(spriteSheetPath, Texture.class)) {
assetManager.load(spriteSheetPath, Texture.class);
assetManager.finishLoading();
}
return TextureRegion.split(assetManager.get(spriteSheetPath, Texture.class), frameWidth, frameHeight);
}
示例13: loadMap
import com.badlogic.gdx.assets.AssetManager; //導入方法依賴的package包/類
protected final GameMap loadMap(final GraphicsService graphicsService, final AssetManager assetManager,
final String mapPath, final Location parentLocation) {
if (!assetManager.isLoaded(mapPath, TiledMap.class)) {
assetManager.load(mapPath, TiledMap.class);
assetManager.finishLoading();
}
TiledMap tiledMap = assetManager.get(mapPath);
TiledMapRenderer mapRenderer = graphicsService.getTileMapRenderer(tiledMap);
return new GameMap(graphicsService.getCamera(), tiledMap, mapRenderer, parentLocation);
}
示例14: getLightTexture
import com.badlogic.gdx.assets.AssetManager; //導入方法依賴的package包/類
static Texture getLightTexture(final AssetManager assetManager) {
if (!assetManager.isLoaded(LIGHT_TEXTURE, Texture.class)) {
assetManager.load(LIGHT_TEXTURE, Texture.class);
assetManager.finishLoading();
}
return assetManager.get(LIGHT_TEXTURE, Texture.class);
}
示例15: getPrefab
import com.badlogic.gdx.assets.AssetManager; //導入方法依賴的package包/類
/** Loads the PrefabDescriber if it isn't yet loaded and then makes a GameObject out of it
*
* @param path - the path to the File containing the PrefabDescription
* @return the GameObject made out of the Prefab */
public static GameObject getPrefab (String path) {
AssetManager assetManager = RavTech.files.getAssetManager();
if (!assetManager.isLoaded(path)) {
assetManager.load(path, String.class);
assetManager.finishLoading();
}
String prefabString = assetManager.get(path);
Debug.startTimer("Prefab");
GameObject object = makeObject(prefabString);
Debug.endTimer("Prefab");
return object;
}