本文整理匯總了Java中com.badlogic.gdx.assets.AssetManager類的典型用法代碼示例。如果您正苦於以下問題:Java AssetManager類的具體用法?Java AssetManager怎麽用?Java AssetManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AssetManager類屬於com.badlogic.gdx.assets包,在下文中一共展示了AssetManager類的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: Sounds
import com.badlogic.gdx.assets.AssetManager; //導入依賴的package包/類
/**
* Sounds constructor.
* Plays the background music and initializes the game dependent sounds.
*
* @param assetManager Place where the sounds and musics are gotten from.
*/
public Sounds(AssetManager assetManager) {
this.assetManager = assetManager;
loadSounds();
Music music = assetManager.get("music/Artofescapism_-_Three_Star_Sky.mp3");
music.setVolume(0.5f);
music.setLooping(true);
music.play();
//Initializing the game different sounds
powerup = assetManager.get("music/item.mp3");
jump = assetManager.get("music/jump.wav");
lost = assetManager.get("music/lost.wav");
won = assetManager.get("music/won.wav");
water = assetManager.get("music/water.wav");
}
示例3: 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);
}
示例4: 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();
}
示例5: AssetsDescribeEnklave
import com.badlogic.gdx.assets.AssetManager; //導入依賴的package包/類
public AssetsDescribeEnklave() {
manager = new AssetManager();
manager.load(NameFiles.buttonExtendCollapse,Texture.class);
manager.load(NameFiles.frameEnk,Texture.class);
manager.load(NameFiles.profileButtonimage,Texture.class);
manager.load(NameFiles.buttonViewGallery,Texture.class);
manager.load(NameFiles.buttonFavoriteEnklave,Texture.class);
manager.load(NameFiles.proportionEnklave,Texture.class);
manager.load(NameFiles.profileButtonimage,Texture.class);
manager.load(NameFiles.cornerBG,Texture.class);
manager.load(NameFiles.imageBarrack,Texture.class);
manager.load(NameFiles.imageCommCenter,Texture.class);
manager.load(NameFiles.imageLaboratory,Texture.class);
manager.load(NameFiles.imageExtensionAutoTurret,Texture.class);
manager.load(NameFiles.imageExtensionRemoteTurret,Texture.class);
manager.load(NameFiles.imageExtensionRegularShield,Texture.class);
manager.load(NameFiles.imageExtensionGammaShield,Texture.class);
}
示例6: 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);
}
示例7: 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);
}
示例8: 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);
}
示例9: loadResurse
import com.badlogic.gdx.assets.AssetManager; //導入依賴的package包/類
public void loadResurse(){
manager = new AssetManager();
manager.load(NameFiles.labelEdenites,Texture.class);
manager.load(NameFiles.labelPrometheans,Texture.class);
manager.load(NameFiles.labelArhitects,Texture.class);
manager.load(NameFiles.txtDescribeEdenites,Texture.class);
manager.load(NameFiles.txtDescribePrometheans,Texture.class);
manager.load(NameFiles.txtDescribeArhitects,Texture.class);
manager.load(NameFiles.frameSelected,Texture.class);
manager.load(NameFiles.labelTitle,Texture.class);
manager.load(NameFiles.logoArhitects3D, Model.class);
manager.load(NameFiles.logoEdenites3D,Model.class);
manager.load(NameFiles.logoEdenites3D,Model.class);
manager.load(NameFiles.logoPrometheans3D,Model.class);
}
示例10: AssetsExtension
import com.badlogic.gdx.assets.AssetManager; //導入依賴的package包/類
public AssetsExtension() {
manager = new AssetManager();
manager.load(NameFiles.imageExtensionGammaShield,Texture.class);
manager.load(NameFiles.imageExtensionRegularShield,Texture.class);
manager.load(NameFiles.imageExtensionRemoteTurret,Texture.class);
manager.load(NameFiles.imageExtensionAutoTurret,Texture.class);
manager.load(NameFiles.frameCarousel,Texture.class);
manager.load(NameFiles.imageArrowRight,Texture.class);
manager.load(NameFiles.imageArrowBottom,Texture.class);
manager.load(NameFiles.txtSelectExtension,Texture.class);
manager.load(NameFiles.imagePulse,Texture.class);
manager.load(NameFiles.extensionImgBackground,Texture.class);
manager.load(NameFiles.leftselectextension,Texture.class);
manager.load(NameFiles.rightselectextension,Texture.class);
manager.load(NameFiles.bottomselectextension,Texture.class);
manager.load(NameFiles.centerselectextension,Texture.class);
manager.load(NameFiles.noselectextension,Texture.class);
manager.load(NameFiles.topenklaveimage,Texture.class);
manager.load(NameFiles.cornerBG ,Texture.class);
manager.load(NameFiles.progressbarcircular,Texture.class);
}
示例11: 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();
}
示例12: DeathScreen
import com.badlogic.gdx.assets.AssetManager; //導入依賴的package包/類
public DeathScreen(Polymorph polymorph,int playerscore) {
AssetManager assetManager = polymorph.getAssetManager();
TextureAtlas textureAtlas = assetManager.get(Polymorph.MASTER_PATH, TextureAtlas.class);
this.polymorph = polymorph;
score=playerscore;
DeathScreenMusic = assetManager.get(Polymorph.MAIN_MENU_MUSIC_PATH);
DeathScreenMusic.setLooping(true);
background = textureAtlas.findRegion("mainmenu"); //TODO make a unique background for the death screen
screenSize = new Dimension(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
camera = new OrthographicCamera();
camera.setToOrtho(false, screenSize.width, screenSize.height); //change this
batch=new SpriteBatch();
batch.setProjectionMatrix(camera.combined);
stage = new Stage();
stage.clear();
font = new BitmapFont(false);
textureAtlas = assetManager.get(Polymorph.MASTER_PATH, TextureAtlas.class);
initButtons(score,textureAtlas);
Gdx.input.setInputProcessor(stage);
}
示例13: initManagers
import com.badlogic.gdx.assets.AssetManager; //導入依賴的package包/類
public void initManagers() {
assetManager = new AssetManager(new LocalFileHandleResolver(), true);
imagePacks = new ObjectMap<String, Array<String>>();
for (String name : new String[] {"characters", "obstacles", "grounds", "clouds", "bushes", "buildings"}) {
imagePacks.put(DATA_PATH + "/" + name, new Array<String>());
}
stateManager = new StateManager(this);
stateManager.addState("loading", new LoadingState("menu", this));
stateManager.addState("menu", new MenuState(this));
stateManager.addState("game", new GameState(this));
stateManager.addState("credits", new CreditsState(this));
spriteBatch = new SpriteBatch();
pixmapPacker = new PixmapPacker(1024, 1024, Pixmap.Format.RGBA8888, 5, true, new PixmapPacker.GuillotineStrategy());
}
示例14: RenderSystem
import com.badlogic.gdx.assets.AssetManager; //導入依賴的package包/類
public RenderSystem(DecalBatch decalBatch, AssetManager assetManager, float worldDegree, Assets.LevelAssets assets) {
super(Aspect.all(RenderComponent.class, PositionComponent.class));
this.levelAssets = assets;
decalMap = new ObjectMap<>();
uiMap = new ObjectMap<>();
this.decalBatch = decalBatch;
this.assetManager = assetManager;
buffers = new ObjectMap<>();
this.spriteBatch = new SpriteBatch();
this.font = assets.uifont;
font.setColor(Color.BLACK);
this.uiCamera = new OrthographicCamera();
Viewport viewportUi = new FitViewport(levelAssets.health_bar_gradient.getWidth(), levelAssets.health_bar_gradient.getHeight(), uiCamera);
viewportUi.update(viewportUi.getScreenWidth(), viewportUi.getScreenHeight(), true);
stateTime = 0;
this.worldDegree = worldDegree;
gradientShader = new ShaderProgram(Shaders.GradientShader.vertexShader, Shaders.GradientShader.fragmentShader);
if (gradientShader.isCompiled() == false)
throw new IllegalArgumentException("couldn't compile shader: " + gradientShader.getLog());
shaderBatch = new SpriteBatch(10, gradientShader);
}
示例15: loadAsync
import com.badlogic.gdx.assets.AssetManager; //導入依賴的package包/類
@Override
public void loadAsync(AssetManager manager, String fileName, FileHandle tmxFile,
com.badlogic.gdx.maps.tiled.AtlasTmxMapLoader.AtlasTiledMapLoaderParameters parameter) {
map = null;
if (parameter != null) {
convertObjectToTileSpace = parameter.convertObjectToTileSpace;
flipY = parameter.flipY;
} else {
convertObjectToTileSpace = false;
flipY = true;
}
try {
map = loadMap(root, tmxFile, new AtlasResolver.AssetManagerAtlasResolver(manager));
} catch (Exception e) {
throw new GdxRuntimeException("Couldn't load tilemap '" + fileName + "'", e);
}
}