public void init() { /*************** ASSET MANAGER ********************/ assetManager.load("data/gui.json", Skin.class, new SkinLoader.SkinParameter(guiAtlas)); assetManager.load(gameAtlas, TextureAtlas.class); assetManager.load("data/mental-space", I18NBundle.class, new I18NBundleLoader.I18NBundleParameter(java.util.Locale.getDefault())); /**************** Load Sounds and music *******************/ SoundManager.getInstance().loadBasicSounds(); MusicManager.getInstance().init(this); MusicManager.getInstance().loadBasics(); /**************** Finish ******************/ this.finishLoading(); this.loadParticles(); }
/** Creates a new AssetManager with all default loaders. */ public AssetManager (FileHandleResolver resolver) { setLoader(BitmapFont.class, new BitmapFontLoader(resolver)); setLoader(Music.class, new MusicLoader(resolver)); setLoader(Pixmap.class, new PixmapLoader(resolver)); setLoader(Sound.class, new SoundLoader(resolver)); setLoader(TextureAtlas.class, new TextureAtlasLoader(resolver)); setLoader(Texture.class, new TextureLoader(resolver)); setLoader(Skin.class, new SkinLoader(resolver)); setLoader(ParticleEffect.class, new ParticleEffectLoader(resolver)); setLoader(PolygonRegion.class, new PolygonRegionLoader(resolver)); setLoader(I18NBundle.class, new I18NBundleLoader(resolver)); setLoader(Model.class, ".g3dj", new G3dModelLoader(new JsonReader(), resolver)); setLoader(Model.class, ".g3db", new G3dModelLoader(new UBJsonReader(), resolver)); setLoader(Model.class, ".obj", new ObjLoader(resolver)); executor = new AsyncExecutor(1); }
private void load () { // Gdx.app.setLogLevel(Logger.DEBUG); start = TimeUtils.nanoTime(); tex1 = new Texture("data/animation.png"); tex2 = new TextureAtlas(Gdx.files.internal("data/pack")); font2 = new BitmapFont(Gdx.files.internal("data/verdana39.fnt"), false); // tex3 = new Texture("data/test.etc1"); // map = TiledLoader.createMap(Gdx.files.internal("data/tiledmap/tilemap csv.tmx")); // atlas = new TileAtlas(map, Gdx.files.internal("data/tiledmap/")); // renderer = new TileMapRenderer(map, atlas, 8, 8); System.out.println("plain took: " + (TimeUtils.nanoTime() - start) / 1000000000.0f); start = TimeUtils.nanoTime(); manager.load("data/animation.png", Texture.class); // manager.load("data/pack1.png", Texture.class); manager.load("data/pack", TextureAtlas.class); // manager.load("data/verdana39.png", Texture.class); manager.load("data/verdana39.fnt", BitmapFont.class); // manager.load("data/multipagefont.fnt", BitmapFont.class); // manager.load("data/test.etc1", Texture.class); // manager.load("data/tiledmap/tilemap csv.tmx", TileMapRenderer.class, new // TileMapRendererLoader.TileMapParameter("data/tiledmap/", 8, 8)); manager.load("data/i18n/message2", I18NBundle.class, new I18NBundleLoader.I18NBundleParameter(reloads % 2 == 0 ? Locale.ITALIAN : Locale.ENGLISH)); }
public LoaderUtils() { resolver = new ResolutionFileResolver(new InternalFileHandleResolver(), resolutions); assetManager = new AssetManager(resolver); assetManager.setErrorListener(this); Texture.setAssetManager(assetManager); assetManager.setLoader(I18NBundle.class, new I18NBundleLoader(resolver)); GUIConfig.initializeValues(resolutions); this.atlas = null; this.regions = new ObjectMap<String, AtlasRegion>(); }
public void changeLang(String locale){ unload("Language/text"); I18NBundleLoader.I18NBundleParameter param = new I18NBundleLoader.I18NBundleParameter(new Locale(locale), "UTF-8"); load("Language/text", I18NBundle.class, param); finishLoading(); b = get("Language/text", I18NBundle.class); GDefence.getInstance().initTips(); GDefence.getInstance().initScreens(); GDefence.getInstance().switchScreen(GDefence.getInstance().getOptionScreen()); }
@Override public void loadAsync(final AssetManager manager, final String fileName, final FileHandle file, final I18NBundleLoader.I18NBundleParameter parameter) { I18NBundle bundle; if (parameter instanceof EagerI18NBundleParameter && ((EagerI18NBundleParameter) parameter).bundle != null) { return; } else if (parameter.encoding == null) { bundle = I18NBundle.createBundle(file, parameter.locale); } else { bundle = I18NBundle.createBundle(file, parameter.locale, parameter.encoding); } synchronized (bundles) { bundles.put(fileName, bundle); } }
public void initLang(String locale){ I18NBundleLoader.I18NBundleParameter param = new I18NBundleLoader.I18NBundleParameter(new Locale(locale), "UTF-8"); load("Language/text", I18NBundle.class, param); finishLoading(); b = get("Language/text", I18NBundle.class); }
@Override @SuppressWarnings("rawtypes") // Raw types due to ugly API. public Array<AssetDescriptor> getDependencies(final String fileName, final FileHandle file, final I18NBundleLoader.I18NBundleParameter parameter) { return null; }