use of com.badlogic.gdx.tests.utils.OrthoCamController in project libgdx by libgdx.
the class TiledMapAtlasAssetManagerTest method create.
@Override
public void create() {
float w = Gdx.graphics.getWidth();
float h = Gdx.graphics.getHeight();
camera = new OrthographicCamera();
camera.setToOrtho(false, (w / h) * 10, 10);
camera.zoom = 2;
camera.update();
cameraController = new OrthoCamController(camera);
Gdx.input.setInputProcessor(cameraController);
font = new BitmapFont();
batch = new SpriteBatch();
AtlasTiledMapLoaderParameters params = new AtlasTiledMapLoaderParameters();
params.forceTextureFilters = true;
params.textureMinFilter = TextureFilter.Linear;
params.textureMagFilter = TextureFilter.Linear;
assetManager = new AssetManager();
assetManager.setErrorListener(new AssetErrorListener() {
@Override
public void error(AssetDescriptor asset, Throwable throwable) {
errorMessage = throwable.getMessage();
}
});
assetManager.setLoader(TiledMap.class, new AtlasTmxMapLoader(new InternalFileHandleResolver()));
assetManager.load(fileName, TiledMap.class);
}
use of com.badlogic.gdx.tests.utils.OrthoCamController in project libgdx by libgdx.
the class TiledMapAtlasDirectLoaderTest method create.
@Override
public void create() {
float w = Gdx.graphics.getWidth();
float h = Gdx.graphics.getHeight();
camera = new OrthographicCamera();
camera.setToOrtho(false, (w / h) * 10, 10);
camera.update();
cameraController = new OrthoCamController(camera);
Gdx.input.setInputProcessor(cameraController);
font = new BitmapFont();
batch = new SpriteBatch();
map = new AtlasTmxMapLoader().load("data/maps/tiled-atlas-processed/test.tmx");
renderer = new OrthogonalTiledMapRenderer(map, 1f / 32f);
}
use of com.badlogic.gdx.tests.utils.OrthoCamController in project libgdx by libgdx.
the class TiledMapDirectLoaderTest method create.
@Override
public void create() {
float w = Gdx.graphics.getWidth();
float h = Gdx.graphics.getHeight();
camera = new OrthographicCamera();
camera.setToOrtho(false, (w / h) * 10, 10);
camera.update();
cameraController = new OrthoCamController(camera);
Gdx.input.setInputProcessor(cameraController);
font = new BitmapFont();
batch = new SpriteBatch();
map = new TmxMapLoader().load("data/maps/tiled/super-koalio/level1.tmx");
renderer = new OrthogonalTiledMapRenderer(map, 1f / 32f);
}
use of com.badlogic.gdx.tests.utils.OrthoCamController in project libgdx by libgdx.
the class TiledMapModifiedExternalTilesetTest method create.
@Override
public void create() {
float w = Gdx.graphics.getWidth();
float h = Gdx.graphics.getHeight();
camera = new OrthographicCamera();
camera.setToOrtho(false, (w / h) * 10, 10);
camera.position.set(10.0f, 2.5f, 0.0f);
camera.update();
cameraController = new OrthoCamController(camera);
Gdx.input.setInputProcessor(cameraController);
font = new BitmapFont();
batch = new SpriteBatch();
// These two maps should appear identical -- a ring of grass with water inside and out.
// The original is correct, without the bug fix to TiledMapTileSets.java that acompanies
// this test, the latter appears as all grass.
// map = new TmxMapLoader().load("data/maps/tiled/external-tilesets/test_original.tmx");
map = new TmxMapLoader().load("data/maps/tiled/external-tilesets/test_extended.tmx");
renderer = new IsometricTiledMapRenderer(map, 1f / 32f);
}
use of com.badlogic.gdx.tests.utils.OrthoCamController in project libgdx by libgdx.
the class TiledMapObjectLoadingTest method create.
@Override
public void create() {
float w = Gdx.graphics.getWidth();
float h = Gdx.graphics.getHeight();
camera = new OrthographicCamera();
camera.setToOrtho(false, (w / h) * 100, 100);
camera.zoom = 2;
camera.update();
cameraController = new OrthoCamController(camera);
Gdx.input.setInputProcessor(cameraController);
font = new BitmapFont();
batch = new SpriteBatch();
map = new TmxMapLoader().load("data/maps/tiled-objects/test-load-mapobjects.tmx");
MapProperties properties = map.getProperties();
shapeRenderer = new ShapeRenderer();
}
Aggregations