summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/zproject/engine
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2018-09-13 16:00:07 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2018-09-13 16:00:07 +0200
commit43147c8440ca5bc0b81e01d14f487811f18d093b (patch)
tree50bbad9a2fa9c1095905c4f03c8e8e034095b0a2 /core/src/ch/asynk/zproject/engine
parent51f5a27571ff5f0d0de057c1034e576246eabe0c (diff)
downloadgdx-boardgame-43147c8440ca5bc0b81e01d14f487811f18d093b.zip
gdx-boardgame-43147c8440ca5bc0b81e01d14f487811f18d093b.tar.gz
Camera : add setDimension(float, float)
Diffstat (limited to 'core/src/ch/asynk/zproject/engine')
-rw-r--r--core/src/ch/asynk/zproject/engine/Camera.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/src/ch/asynk/zproject/engine/Camera.java b/core/src/ch/asynk/zproject/engine/Camera.java
index a3e13e1..35c149b 100644
--- a/core/src/ch/asynk/zproject/engine/Camera.java
+++ b/core/src/ch/asynk/zproject/engine/Camera.java
@@ -48,6 +48,14 @@ public class Camera extends OrthographicCamera
this.hudInvProjMatrix = new Matrix4();
}
+ public void setDimension(float boardWidth, float boardHeight)
+ {
+ setToOrtho(false, boardWidth, boardHeight);
+ this.boardWidth = boardWidth;
+ this.boardHeight = boardHeight;
+ this.boardAspectRatio = (boardWidth / boardHeight);
+ }
+
public void updateViewport(int screenWidth, int screenHeight)
{
this.screenWidth = screenWidth;