Camera and determines how world coordinates are mapped to and from the screen.
| Modifier and Type | Field and Description |
|---|---|
| private Camera | |
| private int | |
| private int | |
| private int | |
| private int | |
| private final Vector3 | |
| private float | |
| private float |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | apply(boolean
If true, the camera position is set to the center of the world. centerCamera)Applies the viewport to the camera and sets the glViewport. |
| public void | |
| public int | |
| public Camera | |
| public int | |
| public Ray | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public float | |
| public float | |
| public Vector2 | |
| public Vector3 | |
| public void | |
| public void | setScreenBounds(int screenX, int screenY, int screenWidth, int screenHeight)
Sets the viewport's bounds in screen coordinates. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public Vector2 | toScreenCoordinates(Vector2 worldCoords, Matrix4 transformMatrix)
Transforms a point to real screen coordinates (as opposed to OpenGL ES window coordinates), where the origin is in the top left and the the y-axis is pointing downwards. |
| public Vector2 | |
| public Vector3 | |
| public final void | |
| public void | update(int screenWidth, int screenHeight, boolean centerCamera)
Configures this viewport's screen bounds using the specified screen size and calls |
| camera | back to summary |
|---|---|
| private Camera camera | |
| screenHeight | back to summary |
|---|---|
| private int screenHeight | |
| screenWidth | back to summary |
|---|---|
| private int screenWidth | |
| screenX | back to summary |
|---|---|
| private int screenX | |
| screenY | back to summary |
|---|---|
| private int screenY | |
| tmp | back to summary |
|---|---|
| private final Vector3 tmp | |
| worldHeight | back to summary |
|---|---|
| private float worldHeight | |
| worldWidth | back to summary |
|---|---|
| private float worldWidth | |
| Viewport | back to summary |
|---|---|
| public Viewport() | |
| apply | back to summary |
|---|---|
| public void apply() Calls | |
| apply | back to summary |
|---|---|
| public void apply(boolean centerCamera) Applies the viewport to the camera and sets the glViewport.
| |
| calculateScissors | back to summary |
|---|---|
| public void calculateScissors(Matrix4 batchTransform, Rectangle area, Rectangle scissor) | |
| getBottomGutterHeight | back to summary |
|---|---|
| public int getBottomGutterHeight() Returns the bottom gutter (black bar) height in screen coordinates. | |
| getCamera | back to summary |
|---|---|
| public Camera getCamera() | |
| getLeftGutterWidth | back to summary |
|---|---|
| public int getLeftGutterWidth() Returns the left gutter (black bar) width in screen coordinates. | |
| getPickRay | back to summary |
|---|---|
| public Ray getPickRay(float touchX, float touchY) | |
| getRightGutterWidth | back to summary |
|---|---|
| public int getRightGutterWidth() Returns the right gutter (black bar) width in screen coordinates. | |
| getRightGutterX | back to summary |
|---|---|
| public int getRightGutterX() Returns the right gutter (black bar) x in screen coordinates. | |
| getScreenHeight | back to summary |
|---|---|
| public int getScreenHeight() | |
| getScreenWidth | back to summary |
|---|---|
| public int getScreenWidth() | |
| getScreenX | back to summary |
|---|---|
| public int getScreenX() | |
| getScreenY | back to summary |
|---|---|
| public int getScreenY() | |
| getTopGutterHeight | back to summary |
|---|---|
| public int getTopGutterHeight() Returns the top gutter (black bar) height in screen coordinates. | |
| getTopGutterY | back to summary |
|---|---|
| public int getTopGutterY() Returns the top gutter (black bar) y in screen coordinates. | |
| getWorldHeight | back to summary |
|---|---|
| public float getWorldHeight() | |
| getWorldWidth | back to summary |
|---|---|
| public float getWorldWidth() | |
| project | back to summary |
|---|---|
| public Vector2 project(Vector2 worldCoords) Transforms the specified world coordinate to screen coordinates.
| |
| project | back to summary |
|---|---|
| public Vector3 project(Vector3 worldCoords) Transforms the specified world coordinate to screen coordinates.
| |
| setCamera | back to summary |
|---|---|
| public void setCamera(Camera camera) | |
| setScreenBounds | back to summary |
|---|---|
| public void setScreenBounds(int screenX, int screenY, int screenWidth, int screenHeight) Sets the viewport's bounds in screen coordinates. This is typically set by | |
| setScreenHeight | back to summary |
|---|---|
| public void setScreenHeight(int screenHeight) Sets the viewport's height in screen coordinates. This is typically set by | |
| setScreenPosition | back to summary |
|---|---|
| public void setScreenPosition(int screenX, int screenY) Sets the viewport's position in screen coordinates. This is typically set by | |
| setScreenSize | back to summary |
|---|---|
| public void setScreenSize(int screenWidth, int screenHeight) Sets the viewport's size in screen coordinates. This is typically set by | |
| setScreenWidth | back to summary |
|---|---|
| public void setScreenWidth(int screenWidth) Sets the viewport's width in screen coordinates. This is typically set by | |
| setScreenX | back to summary |
|---|---|
| public void setScreenX(int screenX) Sets the viewport's offset from the left edge of the screen. This is typically set by
| |
| setScreenY | back to summary |
|---|---|
| public void setScreenY(int screenY) Sets the viewport's offset from the bottom edge of the screen. This is typically set by
| |
| setWorldHeight | back to summary |
|---|---|
| public void setWorldHeight(float worldHeight) The virtual height of this viewport in world coordinates. This height is scaled to the viewport's screen height. | |
| setWorldSize | back to summary |
|---|---|
| public void setWorldSize(float worldWidth, float worldHeight) | |
| setWorldWidth | back to summary |
|---|---|
| public void setWorldWidth(float worldWidth) The virtual width of this viewport in world coordinates. This width is scaled to the viewport's screen width. | |
| toScreenCoordinates | back to summary |
|---|---|
| public Vector2 toScreenCoordinates(Vector2 worldCoords, Matrix4 transformMatrix) Transforms a point to real screen coordinates (as opposed to OpenGL ES window coordinates), where the origin is in the top left and the the y-axis is pointing downwards. | |
| unproject | back to summary |
|---|---|
| public Vector2 unproject(Vector2 touchCoords) Transforms the specified touch coordinate to world coordinates. The x- and y-coordinate of vec are assumed to be in touch coordinates (origin is the top left corner, y * pointing down, x pointing to the right)
| |
| unproject | back to summary |
|---|---|
| public Vector3 unproject(Vector3 screenCoords) Transforms the specified screen coordinate to world coordinates.
| |
| update | back to summary |
|---|---|
| public final void update(int screenWidth, int screenHeight) Calls | |
| update | back to summary |
|---|---|
| public void update(int screenWidth, int screenHeight, boolean centerCamera) Configures this viewport's screen bounds using the specified screen size and calls
The default implementation only calls | |