diff options
| author | Radioactivity <85001747+voidwyrm-2@users.noreply.github.com> | 2025-07-25 15:50:18 -1000 |
|---|---|---|
| committer | Radioactivity <85001747+voidwyrm-2@users.noreply.github.com> | 2025-07-25 15:50:18 -1000 |
| commit | 5069ef5487035faa3a89b31bf29c428da230b079 (patch) | |
| tree | 0f9568cd95004d582b0942a10e61dd6b8f7c1171 | |
| parent | ced33b055f97e6d2882c80f4d7499ff138e77725 (diff) | |
Testing mouse positions
| -rw-r--r-- | src/main.zig | 6 |
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); |
