mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-11 00:08:02 +07:00
Fixed translation issue for mouse movement caused by not applying offset
This commit is contained in:
@ -19,9 +19,7 @@ public class IsometricCamera extends OrthographicCamera {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void translate(Vector2 vec) {
|
public void translate(Vector2 vec) {
|
||||||
position.add(vec);
|
translate(vec.x, vec.y);
|
||||||
toScreen(position.x, position.y, tmp);
|
|
||||||
super.position.set(tmp, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -38,7 +36,7 @@ public class IsometricCamera extends OrthographicCamera {
|
|||||||
public void set(float x, float y) {
|
public void set(float x, float y) {
|
||||||
position.set(x, y);
|
position.set(x, y);
|
||||||
toScreen(position.x, position.y, tmp);
|
toScreen(position.x, position.y, tmp);
|
||||||
super.position.set(tmp.x, tmp.y, 0).add(offset.x, offset.y, 0);
|
super.position.set(tmp, 0).add(offset.x, offset.y, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector2 toScreen(Vector2 worldCoords) {
|
public Vector2 toScreen(Vector2 worldCoords) {
|
||||||
|
Reference in New Issue
Block a user