本文整理汇总了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());
}
}
}
示例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);
}
示例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);
}
示例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;
}