本文整理匯總了Java中com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer.setView方法的典型用法代碼示例。如果您正苦於以下問題:Java OrthogonalTiledMapRenderer.setView方法的具體用法?Java OrthogonalTiledMapRenderer.setView怎麽用?Java OrthogonalTiledMapRenderer.setView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer
的用法示例。
在下文中一共展示了OrthogonalTiledMapRenderer.setView方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: GameScreen
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer; //導入方法依賴的package包/類
public GameScreen(SkyCity skyCity) {
super(skyCity);
state = InputState.GAME;
hud = new Hud(skyCity.batch);
chat = new Chat(skyCity.batch);
mapCamera = new OrthographicCamera(SCREEN_WIDTH, SCREEN_HEIGHT);
gamePort = new FitViewport(SCREEN_WIDTH, SCREEN_HEIGHT, mapCamera);
renderer = new OrthogonalTiledMapRenderer(Assets.getInstance().getTiledMap(), skyCity.batch);
mapCamera.position.set(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, 0);
renderer.setView(mapCamera);
}
示例2: loadMap
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer; //導入方法依賴的package包/類
private void loadMap(Camera camera, String mapName)
{
map = new TmxMapLoader().load(mapName);
renderer = new OrthogonalTiledMapRenderer(map, 1 / Constants.BLOCK_SIZE);
renderer.setView((OrthographicCamera) camera);
mapLayers = map.getLayers();
}
示例3: World
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer; //導入方法依賴的package包/類
public World(MissingWords missingWords) {
this.missingWords = missingWords;
t = new Timer();
/* Cargamos el mapa */
tileMap = new TmxMapLoader().load("minigame.tmx");
/* Creamos el MapRenderer y lo asociamos a nuestra camara del stage */
renderer = new OrthogonalTiledMapRenderer(tileMap, missingWords.getSB());
renderer.setView((OrthographicCamera) missingWords.getGameScreen().getStage().getViewport().getCamera());
/* Creamos las losetas */
playerTile = new StaticTiledMapTile(new TextureRegion((MissingWords.myManager.get("player.png", Texture.class))));
npcTile = new StaticTiledMapTile(new TextureRegion((MissingWords.myManager.get("npc.png", Texture.class))));
transparentTile = new StaticTiledMapTile(new TextureRegion((MissingWords.myManager.get("transparentTile.png", Texture.class))));
holeTile = new StaticTiledMapTile(new TextureRegion((MissingWords.myManager.get("holeGrass.png", Texture.class))));
bothPlayers = new StaticTiledMapTile(new TextureRegion((MissingWords.myManager.get("bothPlayers.png", Texture.class))));
/* Obtenemos las capas del mapa */
pathLayer = (TiledMapTileLayer) tileMap.getLayers().get("Path");
tokenLayer = (TiledMapTileLayer) tileMap.getLayers().get("Tokens");
generateHoles();
createSquares();
placePlayers();
}
示例4: draw
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer; //導入方法依賴的package包/類
@Override
public void draw(SpriteBatch spriteBatch, float deltaSeconds) {
if (!init) {
renderer = new OrthogonalTiledMapRenderer(map, spriteBatch);
init = true;
}
spriteBatch.end();
renderer.setView(spriteBatch.getProjectionMatrix().cpy(), 0, 0,
Display.getRealWidth(), Display.getRealHeight());
renderer.render();
spriteBatch.begin();
}
示例5: init
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer; //導入方法依賴的package包/類
private void init () {
mapRenderer = new OrthogonalTiledMapRenderer(worldController.mapMgr.getCurrentMap());
mapRenderer.setView(worldController.camera);
Gdx.app.debug(TAG, "UnitScale value is: " + mapRenderer.getUnitScale());
}