use of com.badlogic.gdx.assets.loaders.resolvers.ClasspathFileHandleResolver in project high-flyer by sangngh.
the class AbstractLevel method init.
protected void init() {
camera = new OrthographicCamera();
camera.setToOrtho(false, game.getSettings().getWindowWidth(), game.getSettings().getWindowHeight());
camera.update();
final String tiledMapPath = "data/screens/" + getLevelMap();
assetManager = new AssetManager();
assetManager.setLoader(TiledMap.class, new TmxMapLoader(new ClasspathFileHandleResolver()));
assetManager.load(tiledMapPath, TiledMap.class);
assetManager.load(SPRITES, Texture.class);
assetManager.finishLoading();
TiledMap map = assetManager.get(tiledMapPath);
renderer = new OrthogonalTiledMapRenderer(map);
player = new Player(this.game, getSpriteTextures(), map.getLayers(), 480, 1045);
player.setPosition(0 * TILE_SIZE, 6 * TILE_SIZE);
player.rotate(90);
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("data/fonts/Amatic-Bold.ttf"));
FreeTypeFontParameter parameter = new FreeTypeFontParameter();
parameter.size = 40;
// parameter.characters = "Score: "+game.getState().getScore();
bitMapFontName = generator.generateFont(parameter);
generator.dispose();
}
Aggregations