summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRadioactivity <85001747+voidwyrm-2@users.noreply.github.com>2025-07-25 15:50:18 -1000
committerRadioactivity <85001747+voidwyrm-2@users.noreply.github.com>2025-07-25 15:50:18 -1000
commit5069ef5487035faa3a89b31bf29c428da230b079 (patch)
tree0f9568cd95004d582b0942a10e61dd6b8f7c1171 /src
parentced33b055f97e6d2882c80f4d7499ff138e77725 (diff)
Testing mouse positions
Diffstat (limited to 'src')
-rw-r--r--src/main.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.zig b/src/main.zig
index 3aa5c1f..7271824 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -520,10 +520,10 @@ const ScreenMainMenu = struct {
rl.beginMode2D(self.camera);
defer rl.endMode2D();
- const msp = rl.getMousePosition();
+ const msp = rl.getMousePosition().scale(1 / self.camera.zoom);
- const x = msp.x / (cells_width * cells_height);
- const y = msp.y / (cells_width * cells_height);
+ const x = msp.x / cell_size;
+ const y = msp.y / cell_size;
rl.drawRectangleRec(rl.Rectangle.init(x, y, 100, 100), rl.Color.white);