mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-12 00:07:33 +00:00
Add parameterised mouse point rescaling helper for events
This commit is contained in:
1 parent
9411dd0808
commit
0ba1132ff6
1 file changed
+6
-2
@@ -110,10 +110,14 @@ public class GuiDraw
|
||||
return new Dimension(mc.displayWidth, mc.displayHeight);
|
||||
}
|
||||
|
||||
public static Point getMousePosition() {
|
||||
public static Point getMousePosition(int eventX, int eventY) {
|
||||
Dimension size = displaySize();
|
||||
Dimension res = displayRes();
|
||||
return new Point(Mouse.getX() * size.width / res.width, size.height - Mouse.getY() * size.height / res.height - 1);
|
||||
return new Point(eventX * size.width / res.width, size.height - eventY * size.height / res.height - 1);
|
||||
}
|
||||
|
||||
public static Point getMousePosition() {
|
||||
return getMousePosition(Mouse.getX(), Mouse.getY());
|
||||
}
|
||||
|
||||
public static void changeTexture(String s) {
|
||||
|
||||
Reference in new issue
Block a user