|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.badlogic.gdx.utils.viewport.Viewport
public abstract class Viewport
Manages a Camera
and determines how world coordinates are mapped to and from the screen.
Constructor Summary | |
---|---|
Viewport()
|
Method Summary | |
---|---|
void |
calculateScissors(Matrix4 batchTransform,
Rectangle area,
Rectangle scissor)
|
int |
getBottomGutterHeight()
Returns the bottom gutter (black bar) height in screen coordinates. |
Camera |
getCamera()
|
int |
getLeftGutterWidth()
Returns the left gutter (black bar) width in screen coordinates. |
Ray |
getPickRay(float screenX,
float screenY)
|
int |
getRightGutterWidth()
Returns the right gutter (black bar) width in screen coordinates. |
int |
getRightGutterX()
Returns the right gutter (black bar) x in screen coordinates. |
int |
getTopGutterHeight()
Returns the top gutter (black bar) height in screen coordinates. |
int |
getTopGutterY()
Returns the top gutter (black bar) y in screen coordinates. |
int |
getViewportHeight()
|
int |
getViewportWidth()
|
int |
getViewportX()
|
int |
getViewportY()
|
float |
getWorldHeight()
|
float |
getWorldWidth()
|
Vector2 |
project(Vector2 worldCoords)
Transforms the specified world coordinate to screen coordinates. |
Vector3 |
project(Vector3 worldCoords)
Transforms the specified world coordinate to screen coordinates. |
void |
setCamera(Camera camera)
|
void |
setWorldHeight(float worldHeight)
|
void |
setWorldSize(float worldWidth,
float worldHeight)
|
void |
setWorldWidth(float worldWidth)
|
Vector2 |
toScreenCoordinates(Vector2 worldCoords,
Matrix4 transformMatrix)
Transforms a point to real screen coordinates (as oposed to OpenGL ES window coordinates), where the origin is in the top left and the the y-axis is pointing downwards. |
Vector2 |
unproject(Vector2 screenCoords)
Transforms the specified screen coordinate to world coordinates. |
Vector3 |
unproject(Vector3 screenCoords)
Transforms the specified screen coordinate to world coordinates. |
void |
update()
Updates the viewport using the last computed values without changing the camera position. |
void |
update(int screenWidth,
int screenHeight)
Updates the viewport's camera without changing the camera position. |
void |
update(int screenWidth,
int screenHeight,
boolean centerCamera)
Updates the viewport's camera. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Viewport()
Method Detail |
---|
public final void update()
public final void update(int screenWidth, int screenHeight)
update(int, int, boolean)
public void update(int screenWidth, int screenHeight, boolean centerCamera)
ApplicationListener#resize(int, int)
or
Screen#resize(int, int)
.
The default implementation calls GL20.glViewport(int, int, int, int)
and configures the camera viewport size.
centerCamera
- If true, the camera position is set to the center of the world.public Vector2 unproject(Vector2 screenCoords)
Camera.unproject(Vector3)
public Vector2 project(Vector2 worldCoords)
Camera.project(Vector3)
public Vector3 unproject(Vector3 screenCoords)
Camera.unproject(Vector3)
public Vector3 project(Vector3 worldCoords)
Camera.project(Vector3)
public Ray getPickRay(float screenX, float screenY)
Camera.getPickRay(float, float, float, float, float, float)
public void calculateScissors(Matrix4 batchTransform, Rectangle area, Rectangle scissor)
ScissorStack.calculateScissors(Camera, float, float, float, float, Matrix4, Rectangle, Rectangle)
public Vector2 toScreenCoordinates(Vector2 worldCoords, Matrix4 transformMatrix)
public Camera getCamera()
public void setCamera(Camera camera)
public void setWorldSize(float worldWidth, float worldHeight)
public float getWorldWidth()
public void setWorldWidth(float worldWidth)
public float getWorldHeight()
public void setWorldHeight(float worldHeight)
public int getViewportX()
public int getViewportY()
public int getViewportWidth()
public int getViewportHeight()
public int getLeftGutterWidth()
public int getRightGutterX()
public int getRightGutterWidth()
public int getBottomGutterHeight()
public int getTopGutterY()
public int getTopGutterHeight()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |