/** 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); }
public Assets() { textureParameter = new TextureLoader.TextureParameter(); //textureParameter.genMipMaps = true; textureParameter.magFilter = Texture.TextureFilter.Linear; textureParameter.minFilter = Texture.TextureFilter.Linear; resolver = new MaryoFileHandleResolver(); manager = new AssetManager(resolver); particleEffectParameter = new ParticleEffectLoader.ParticleEffectParameter(); particleEffectParameter.imagesDir = resolver.resolve("data/animation/particles"); // set the loaders for the generator and the fonts themselves manager.setLoader(FreeTypeFontGenerator.class, new FreeTypeFontGeneratorLoader(resolver)); manager.setLoader(BitmapFont.class, ".ttf", new FreetypeFontLoader(resolver)); manager.setLoader(ParticleEffect.class, ".p", new ParticleEffectLoader(resolver)); manager.setLoader(Sound.class, ".mp3", new SoundLoader(new InternalFileHandleResolver())); manager.setLoader(Music.class, ".mp3", new MusicLoader(new InternalFileHandleResolver())); }
@Override public void create() { game_prefs = Gdx.app.getPreferences(prefs_name); game_stage = new Stage(view); game_states = new ObjectMap<String, GameState>(); game_stage.setDebugAll(false); current_gamestates = new Array<GameState>(); transition_state = new GameState(null); transition_state.setGame(this); assets = new AssetManager(); assets.setLoader(TiledMap.class, new KyperMapLoader(assets.getFileHandleResolver())); assets.setLoader(ParticleEffect.class, new ParticleEffectLoader(assets.getFileHandleResolver())); assets.setLoader(ShaderProgram.class, new ShaderProgramLoader(assets.getFileHandleResolver(), VERTEX_SUFFIX, FRAGMENT_SUFFIX)); sound = new SoundManager(this); packages = new Array<String>(); packages.add("com.kyperbox.objects"); global_data = new UserData(GAME_DATA_NAME); input = new GameInput(); Gdx.input.setInputProcessor(game_stage); initiate(); }