public class OrthographicCamera extends Camera
Modifier and Type | Field and Description |
---|---|
float |
zoom
the zoom of the camera
|
combined, direction, far, frustum, invProjectionView, near, position, projection, up, view, viewportHeight, viewportWidth
Constructor and Description |
---|
OrthographicCamera() |
OrthographicCamera(float viewportWidth,
float viewportHeight)
Constructs a new OrthographicCamera, using the given viewport width and height.
|
Modifier and Type | Method and Description |
---|---|
void |
rotate(float angle)
Rotates the camera by the given angle around the direction vector.
|
void |
setToOrtho(boolean yDown)
Sets this camera to an orthographic projection using a viewport fitting the screen resolution, centered at
(Gdx.graphics.getWidth()/2, Gdx.graphics.getHeight()/2), with the y-axis pointing up or down.
|
void |
setToOrtho(boolean yDown,
float viewportWidth,
float viewportHeight)
Sets this camera to an orthographic projection, centered at (viewportWidth/2, viewportHeight/2), with the y-axis pointing up
or down.
|
void |
translate(float x,
float y)
Moves the camera by the given amount on each axis.
|
void |
translate(Vector2 vec)
Moves the camera by the given vector.
|
void |
update()
Recalculates the projection and view matrix of this camera and the
Frustum planes. |
void |
update(boolean updateFrustum)
Recalculates the projection and view matrix of this camera and the
Frustum planes if updateFrustum is
true. |
getPickRay, getPickRay, lookAt, lookAt, normalizeUp, project, project, rotate, rotate, rotate, rotate, rotateAround, transform, translate, translate, unproject, unproject
public OrthographicCamera()
public OrthographicCamera(float viewportWidth, float viewportHeight)
viewportWidth
- the viewport widthviewportHeight
- the viewport heightpublic void update()
Camera
Frustum
planes. Use this after you've manipulated
any of the attributes of the camera.public void update(boolean updateFrustum)
Camera
Frustum
planes if updateFrustum
is
true. Use this after you've manipulated any of the attributes of the camera.public void setToOrtho(boolean yDown)
yDown
- whether y should be pointing downpublic void setToOrtho(boolean yDown, float viewportWidth, float viewportHeight)
yDown
- whether y should be pointing down.viewportWidth
- viewportHeight
- public void rotate(float angle)
angle
- public void translate(float x, float y)
x
- the displacement on the x-axisy
- the displacement on the y-axispublic void translate(Vector2 vec)
vec
- the displacement vectorCopyright © 2014. All rights reserved.