当前位置: 首页>>代码示例>>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;未经允许,请勿转载。