summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/gdx/boardgame/Camera.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Camera.java b/core/src/ch/asynk/gdx/boardgame/Camera.java
index 5140538..d72f15c 100644
--- a/core/src/ch/asynk/gdx/boardgame/Camera.java
+++ b/core/src/ch/asynk/gdx/boardgame/Camera.java
@@ -4,6 +4,7 @@ import com.badlogic.gdx.graphics.glutils.HdpiUtils;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.math.Rectangle;
+import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Matrix4;
@@ -179,6 +180,11 @@ public class Camera extends OrthographicCamera
}
}
+ public void unprojectTranslation(int dx, int dy, Vector2 v)
+ {
+ v.set((dx * zoom * widthFactor), (-dy * zoom * heightFactor));
+ }
+
public void unproject(int x, int y, Vector3 v)
{
unproject(v.set(x, y, 0), viewport.x, viewport.y, viewport.width, viewport.height);