diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-28 19:34:42 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-28 19:34:42 +0200 |
commit | 7c5123ff64c751c19411982189321be3511a9815 (patch) | |
tree | 0258163a1cdd33b2711d121055751e027f7d6e41 /src/main/java/io/polyfrost/oneconfig/utils | |
parent | ff0a0079ffc9dccdf1fffd0616ec724eb048f771 (diff) | |
parent | 9c028b9e55f3968ec3651c7063c0ffd81b027596 (diff) | |
download | OneConfig-7c5123ff64c751c19411982189321be3511a9815.tar.gz OneConfig-7c5123ff64c751c19411982189321be3511a9815.tar.bz2 OneConfig-7c5123ff64c751c19411982189321be3511a9815.zip |
Merge branch 'master' of github.com:Polyfrost/OneConfig
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/utils')
-rw-r--r-- | src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java b/src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java index 1ce1a30..e030c29 100644 --- a/src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java +++ b/src/main/java/io/polyfrost/oneconfig/utils/InputUtils.java @@ -14,4 +14,16 @@ public class InputUtils { int mouseY = Minecraft.getMinecraft().displayHeight - Math.abs(Mouse.getY()); return mouseX > x && mouseY > y && mouseX < x + width && mouseY < y + height; // TODO add scaling info } + + public static boolean isClicked(int x, int y, int width, int height) { + return isAreaHovered(x, y, width, height) && Mouse.isButtonDown(0); // TODO make actually do what its meant to do (only 1 event) + } + + public static int mouseX() { + return Mouse.getX(); + } + + public static int mouseY() { + return Minecraft.getMinecraft().displayHeight - Math.abs(Mouse.getY()); + } } |