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


Java Camera.unproject方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.graphics.Camera.unproject方法的典型用法代碼示例。如果您正苦於以下問題:Java Camera.unproject方法的具體用法?Java Camera.unproject怎麽用?Java Camera.unproject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.graphics.Camera的用法示例。


在下文中一共展示了Camera.unproject方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: processSelection

import com.badlogic.gdx.graphics.Camera; //導入方法依賴的package包/類
private void processSelection(Entity entity, Map map, Camera camera, boolean selected) {
camera.unproject(mouseLocation);

Entity selectedEntity = getEntity(entity, map);
if (selectedEntity != null) {
    selectedEntity.sendMessage(selected ? MessageType.SELECTED : MessageType.DESELECTED);
    if (selected && selectedEntity.getConfig().getConversationConfigPath() != null) {
	map.setCurrentSelectedEntity(selectedEntity);
	fireComponentEvent(ComponentEvent.LOAD_CONVERSATION, selectedEntity.getConfig().getConversationConfigPath(), selectedEntity.getType());
    }
}
   }
 
開發者ID:Quillraven,項目名稱:Quilly-s-Castle,代碼行數:13,代碼來源:PlayerInputComponent.java

示例2: computeCullingRectangle

import com.badlogic.gdx.graphics.Camera; //導入方法依賴的package包/類
public void computeCullingRectangle() {
	Camera camera = map.getCamera();
	Vector3 tempVector = MathUtil.getVector3();
	tempVector.set(0, 0, 0);
	camera.unproject(tempVector);
	map.projectToTiles(tempVector);
	int x = (int) MathUtils.clamp(tempVector.x, 0, map.getMapWidth() - 1);

	tempVector.set(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), 0);
	camera.unproject(tempVector);
	map.projectToTiles(tempVector);
	int width = (int) MathUtils.clamp(tempVector.x, 0,
			map.getMapWidth() - 1) - x;

	tempVector.set(0, Gdx.graphics.getHeight(), 0);
	camera.unproject(tempVector);
	map.projectToTiles(tempVector);
	int y = (int) MathUtils.clamp(tempVector.y, 0, map.getMapHeight() - 1);

	tempVector.set(Gdx.graphics.getWidth(), 0, 0);
	camera.unproject(tempVector);
	map.projectToTiles(tempVector);
	int height = (int) MathUtils.clamp(tempVector.y, 0,
			map.getMapHeight() - 1) - y;

	MathUtil.freeVector3(tempVector);

	getCullingRectangle().set(x - 1, y - 1, width + 2, height + 2);
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:30,代碼來源:GameMapRenderer.java

示例3: getMousePositionWithCamera

import com.badlogic.gdx.graphics.Camera; //導入方法依賴的package包/類
@Deprecated
public static Vector3 getMousePositionWithCamera(Camera camera) {
    tmpVector.set(Gdx.input.getX(), Gdx.input.getY(), 0);
    return camera.unproject(tmpVector);
}
 
開發者ID:opensourcegamedev,項目名稱:SpaceChaos,代碼行數:6,代碼來源:MouseUtils.java

示例4: touchToWorld

import com.badlogic.gdx.graphics.Camera; //導入方法依賴的package包/類
public static Vector2 touchToWorld(Vector2 point, Camera camera) {
    vector3.set(point, 0);
    camera.unproject(vector3);
    point.set(vector3.x, vector3.y);
    return point;
}
 
開發者ID:MiniDigger,項目名稱:projecttd,代碼行數:7,代碼來源:CoordinateUtil.java


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