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