From 43147c8440ca5bc0b81e01d14f487811f18d093b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 13 Sep 2018 16:00:07 +0200 Subject: Camera : add setDimension(float, float) --- core/src/ch/asynk/zproject/engine/Camera.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- cgit v1.1-2-g2b99