diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2018-09-13 16:00:07 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2018-09-13 16:00:07 +0200 |
commit | 43147c8440ca5bc0b81e01d14f487811f18d093b (patch) | |
tree | 50bbad9a2fa9c1095905c4f03c8e8e034095b0a2 | |
parent | 51f5a27571ff5f0d0de057c1034e576246eabe0c (diff) | |
download | gdx-boardgame-43147c8440ca5bc0b81e01d14f487811f18d093b.zip gdx-boardgame-43147c8440ca5bc0b81e01d14f487811f18d093b.tar.gz |
Camera : add setDimension(float, float)
-rw-r--r-- | core/src/ch/asynk/zproject/engine/Camera.java | 8 |
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; |