Search in sources :

Example 1 with TextureLoader

use of com.badlogic.gdx.assets.loaders.TextureLoader in project libgdx by libgdx.

the class AssetManagerTest method create.

public void create() {
    Gdx.app.setLogLevel(Application.LOG_ERROR);
    Resolution[] resolutions = { new Resolution(320, 480, ".320480"), new Resolution(480, 800, ".480800"), new Resolution(480, 856, ".480854") };
    ResolutionFileResolver resolver = new ResolutionFileResolver(new InternalFileHandleResolver(), resolutions);
    manager = new AssetManager();
    manager.setLoader(Texture.class, new TextureLoader(resolver));
    manager.setErrorListener(this);
    load();
    Texture.setAssetManager(manager);
    batch = new SpriteBatch();
    font = new BitmapFont(Gdx.files.internal("data/font.fnt"), false);
}
Also used : ResolutionFileResolver(com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver) AssetManager(com.badlogic.gdx.assets.AssetManager) InternalFileHandleResolver(com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver) TextureLoader(com.badlogic.gdx.assets.loaders.TextureLoader) BitmapFont(com.badlogic.gdx.graphics.g2d.BitmapFont) SpriteBatch(com.badlogic.gdx.graphics.g2d.SpriteBatch) Resolution(com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution)

Aggregations

AssetManager (com.badlogic.gdx.assets.AssetManager)1 TextureLoader (com.badlogic.gdx.assets.loaders.TextureLoader)1 InternalFileHandleResolver (com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver)1 ResolutionFileResolver (com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver)1 Resolution (com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution)1 BitmapFont (com.badlogic.gdx.graphics.g2d.BitmapFont)1 SpriteBatch (com.badlogic.gdx.graphics.g2d.SpriteBatch)1