summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-01-05 17:28:37 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-01-05 17:28:37 +0100
commit0696b383bbd2d7b5897fa3b81b3502af21adad06 (patch)
tree10627b668de6e7799da4114f6650dffebc402f97 /core
parentb6e57a768e863a3c20146c6d5d3f5cc459fb78e6 (diff)
downloadRustAndDust-0696b383bbd2d7b5897fa3b81b3502af21adad06.zip
RustAndDust-0696b383bbd2d7b5897fa3b81b3502af21adad06.tar.gz
GameCamera: remembers about screen width and height
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/screens/GameCamera.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/core/src/ch/asynk/tankontank/screens/GameCamera.java b/core/src/ch/asynk/tankontank/screens/GameCamera.java
index 6b89e24..85e2233 100644
--- a/core/src/ch/asynk/tankontank/screens/GameCamera.java
+++ b/core/src/ch/asynk/tankontank/screens/GameCamera.java
@@ -13,8 +13,8 @@ public class GameCamera extends OrthographicCamera
{
private static final float ZEROF = 0.01f;
- // private int screenWidth;
- // private int screenHeight;
+ private int screenWidth;
+ private int screenHeight;
private float zoomOut;
private float zoomIn;
private float widthFactor;
@@ -35,8 +35,8 @@ public class GameCamera extends OrthographicCamera
public void updateViewport(int screenWidth, int screenHeight)
{
- // this.screenWidth = screenWidth;
- // this.screenHeight = screenHeight;
+ this.screenWidth = screenWidth;
+ this.screenHeight = screenHeight;
float viewportAspect = (viewportWidth / viewportHeight);
float aspect = (screenWidth / (float) screenHeight);
@@ -72,6 +72,16 @@ public class GameCamera extends OrthographicCamera
return hudMatrix;
}
+ public int getScreenWidth()
+ {
+ return screenWidth;
+ }
+
+ public int getScreenHeight()
+ {
+ return screenHeight;
+ }
+
public int getHudWidth()
{
return (int) window.width;