add inputProcesser
This commit is contained in:
@@ -148,4 +148,6 @@ public class MainGame extends ApplicationAdapter {
|
||||
public int getHorizontalTileAmount() {
|
||||
return map.getWidth();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package netwerkprog.game.util.application;
|
||||
|
||||
public class InputTransform {
|
||||
|
||||
public static float getCursorToModelX(int screenwidth, int screenX, int cursorX) {
|
||||
return (((float) cursorX) * screenwidth) / ((float) screenX);
|
||||
}
|
||||
|
||||
public static float getCursorToModelY(int screenHeight, int screenY, int cursorY) {
|
||||
return ((float) (screenY - cursorY)) * screenHeight / ((float) screenY);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user