當前位置: 首頁>>代碼示例>>Java>>正文


Java OrthogonalTiledMapRenderer.setView方法代碼示例

本文整理匯總了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);

}
 
開發者ID:guojiank,項目名稱:skycity,代碼行數:16,代碼來源:GameScreen.java

示例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();
}
 
開發者ID:mfkaptan,項目名稱:freeze-fire-tag,代碼行數:8,代碼來源:Board.java

示例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();
}
 
開發者ID:adrianoubk,項目名稱:Missing_Words,代碼行數:30,代碼來源:World.java

示例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();
}
 
開發者ID:LostCodeStudios,項目名稱:JavaLib,代碼行數:14,代碼來源:TileMap.java

示例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());
}
 
開發者ID:Mignet,項目名稱:Inspiration,代碼行數:6,代碼來源:WorldRenderer.java


注:本文中的com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer.setView方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。