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(); }
/** * 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"); }
@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); }
@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(); }
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); }
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); }
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); }
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); }
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); }
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); }
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(); }
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); }
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()); }
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); }
@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); } }
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); }
@Override public void create() { batch = new SpriteBatch(); shapeRenderer = new ShapeRenderer(); keys = new HashMap<Integer, AtomicBoolean>(); manager = new AssetManager(); sprites = new HashMap<String, Sprite>(); this.loadKeys(); this.loadAssets(); introScreen = new IntroScreen(this); dungeonScreen = new DungeonScreen(this); endScreen = new EndScreen(this); this.switchScreen(introScreen); }
@Override public void show() { super.show(); layout = new GlyphLayout(); font = new NativeFont(new NativeFontPaint(25)); font.appendText("正在加载...0123456789%"); font.setColor(Color.BLACK); layout.setText(font, "正在加载...100%"); stage = new Stage(new StretchViewport(1280, 720)); assetManager = new AssetManager(); assetManager.setLogger(new Logger("log", Logger.DEBUG)); assetManager.setLoader(CocosScene.class, new CocosLoader(new InternalFileHandleResolver())); assetManager.load("mainscene/MenuScene.json", CocosScene.class); }
/** Инициализация и загрузка ресурсов */ @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); }
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(); }
@Override public Level loadSync( AssetManager manager, String fileName, FileHandle file, LevelParameters levelParameters) { Stopwatch stopwatch = Stopwatch.createStarted(); Level level = LevelManager.getLevel( levelParameters.serialisableLevel, levelParameters.difficulty, levelParameters.tutorial); Gdx.app.debug(LOGGING_TAG, +stopwatch.elapsed( TimeUnit.NANOSECONDS) * MathUtils.nanoToSec + "s"); return level; }
protected void loadAsyncImages() { // Check if we need to load level icons and if they are loaded show them. if (!this.asyncImages.isEmpty()) { AssetManager assMan = AssMan.getAssMan(); ArrayList<String> texturePaths = new ArrayList<>(this.asyncImages.keySet()); for (String texturePath : texturePaths) { if (assMan.update() || assMan.isLoaded(texturePath)) { Texture texture = assMan.get(texturePath); texture.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear); this.asyncImages.get(texturePath) .setDrawable(new TextureRegionDrawable(new TextureRegion(texture))); this.asyncImages.remove(texturePath); } } } }
public ShaderManager (String shaderDir, AssetManager am, boolean addProcessors) { shaders = new ObjectMap<String, ShaderProgram>(); shaderPaths = new ObjectMap<String, String>(); sourcesVert = new ObjectMap<String, String>(); sourcesFrag = new ObjectMap<String, String>(); frameBuffers = new ObjectMap<String, FrameBuffer>(); openedFrameBuffers = new Array<String>(true, MAX_FRAMEBUFFERS); screenCamera = new OrthographicCamera(Gdx.graphics.getWidth() + 2, Gdx.graphics.getHeight() + 2); createScreenQuad(); screenCamera.translate(0, -1); screenCamera.update(); setShaderDir(shaderDir); setAssetManager(am); // add("empty", "empty.vert", "empty.frag"); // add("default", "default.vert", "default.frag"); if (addProcessors && (Gdx.app.getType() == ApplicationType.Desktop || Gdx.app.getType() == ApplicationType.Applet || Gdx.app.getType() == ApplicationType.WebGL)) { /* * add("processor", "processor.vert", "processor.frag"); add("processor_blur", "processor.vert", "processor_blur.frag"); * add("copy", "processor.vert", "copy.frag"); add("processor_draw", "processor.vert", "processor_draw.frag"); * add("processor_fill", "processor.vert", "processor_fill.frag"); */ } }
@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); } }
@Override public void loadAsync(AssetManager manager, String fileName, FileHandle file, ThesaurusLoader.ThesaurusParameter parameter) { Constructor constructor = new Constructor(ThesaurusData.class); Yaml yaml = new Yaml(constructor); ObjectMap<String, ThesaurusData> data = new ObjectMap<String, ThesaurusData>(); for (Object o : yaml.loadAll(resolve(fileName).read())) { ThesaurusData description = (ThesaurusData) o; data.put(description.key, description); } if (parameter != null && parameter.other.length > 0) { for (String depName : parameter.other) { Thesaurus dep = manager.get(depName); data.putAll(dep.data); } } thesaurus = new Thesaurus(data); }
@Override public void create() { Gdx.app.setLogLevel(Application.LOG_DEBUG); Gdx.input.setCatchBackKey(true); Gdx.input.setCatchMenuKey(true); Config.clearRegions(); Config.shapeRenderer = new ShapeRenderer(); Config.assetManager = new AssetManager(); Config.preferences = new DicePreferences(Gdx.app.getPreferences("com.vlaaad.dice.preferences"), this); Tutorial.killAll(); setState(new IntroState(new IntroState.Callback() { @Override public void onEnded() { setScale(Config.preferences.getScale()); setState(new LoadGameResourcesState(new LoadGameResourcesState.Callback() { @Override public void onResourcesLoaded() { start(); } })); } })); }
@SuppressWarnings("unchecked") @Override public void loadAsync (AssetManager manager, String fileName, FileHandle file, BehaviorTreeParameter parameter) { this.behaviorTree = null; Object blackboard = null; BehaviorTreeParser parser = null; if (parameter != null) { blackboard = parameter.blackboard; parser = parameter.parser; } if (parser == null) parser = new BehaviorTreeParser(); Reader reader = null; try { reader = file.reader(); this.behaviorTree = parser.parse(reader, blackboard); } finally { StreamUtils.closeQuietly(reader); } }
/** * {@inheritDoc} */ @Override public void create() { batch = new SpriteBatch(); assetManager = new AssetManager(); skin1 = new Skin(Gdx.files.internal("appearance/Armadillo.json"), new TextureAtlas("appearance/Armadillo.atlas")); skin2 = new Skin(Gdx.files.internal("appearance/smallBtn.json"), new TextureAtlas("appearance/smallBtn.atlas")); loadAssets(); setMusic(); startGame(); }
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(); }
public AssetSounds(AssetManager am) { jump = am.get("sounds/jump.wav", Sound.class); jumpWithFeather = am.get("sounds/jump_with_feather.wav", Sound.class); pickupCoin = am.get("sounds/pickup_coin.wav", Sound.class); pickupFeather = am.get("sounds/pickup_feather.wav", Sound.class); liveLost = am.get("sounds/live_lost.wav", Sound.class); }
@Override public void create () { Gdx.app.setLogLevel(Application.LOG_DEBUG); Assets.instance.init(new AssetManager()); worldController = new WorldController(); worldRenderer = new WorldRenderer(worldController); paused = false; }
@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); }
@Override protected void onInit(ScreenBasedGame game, AssetManager assetManager) { // load & get assets game.getAssetManager().load(GAMEOVER_SOUND_PATH, Sound.class); game.getAssetManager().load(BG_IMAGE_PATH, Texture.class); game.getAssetManager().finishLoadingAsset(GAMEOVER_SOUND_PATH); game.getAssetManager().finishLoadingAsset(BG_IMAGE_PATH); sound = game.getAssetManager().get(GAMEOVER_SOUND_PATH); this.bgTexture = game.getAssetManager().get(BG_IMAGE_PATH); // generate fonts this.font = BitmapFontFactory.createFont("./data/font/spartakus/SparTakus.ttf", 48, Color.WHITE, Color.BLUE, 3); this.buttonFont = BitmapFontFactory.createFont("data/font/arial/arial.ttf", 32, Color.WHITE); //back to menu button this.menuButton = new TextButton("Back to Menu", this.buttonFont); this.menuButton.setDimension(/* 200 */400, /* 50 */50); this.menuButton.setPosition(game.getViewportWidth() / 2 - (menuButton.getWidth() / 2), 260); this.menuButton.setClickListener(() -> game.getScreenManager().leaveAllAndEnter("menu")); //replay button this.replayButton = new TextButton("Replay", this.buttonFont); this.replayButton.setDimension(400, 50); this.replayButton.setPosition(game.getViewportWidth() / 2 - (menuButton.getWidth() / 2), 200); this.replayButton.setClickListener(() -> { game.getScreenManager().leaveAllAndEnter("game"); }); }
@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); }
@Override public void show() { super.show(); assets = new AssetManager(); assets.load("theme/basic/campaign/scene.g3db", Model.class); modelBatch = new ModelBatch(); environment = new Environment(); environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 1f, 1f, 1f, 1f)); //environment.add(new DirectionalLight().set(1f, 1f, 1f, -1f, -1f, -1f)); addDisposables(modelBatch, assets); }
private AssetManager getAssetManager(Source source) { switch (source) { case EXTERNAL: return externalAssets; case INTERNAL: return assets; case ZIP: return assets; default: return assets; } }
private <T> Map<String, T> getAssetMap(AssetManager assetManager, Class<T> clazz, Map<String, T> map) { for (T asset : assetManager.getAll(clazz, new Array<T>())) { String name = assetManager.getAssetFileName(asset); map.put(name.substring(name.lastIndexOf("/") + 1, name.indexOf(".")), asset); } return map; }
public AssetsLoadingN() { manager =new AssetManager(); manager.load(NameFiles.loadoverlayshape, Texture.class); manager.load(NameFiles.loadtransientblue,Texture.class); manager.load(NameFiles.loadtransientgreen,Texture.class); manager.load(NameFiles.loadtransientred,Texture.class); manager.load(NameFiles.logoTextENKLAVE,Texture.class); }
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); }
public AssetsScreenBricks() { manager = new AssetManager(); manager.load(NameFiles.bricksMaps,Texture.class); manager.load(NameFiles.circleEnklave,Texture.class); manager.load(NameFiles.insideEnklave,Texture.class); manager.load(NameFiles.topEnklave3D,Texture.class); manager.load(NameFiles.baseEnklave3D,Texture.class); }