From fe14f2723ca58e509efa44a5a9fde3b61f5db1e7 Mon Sep 17 00:00:00 2001 From: Jason Hilder Date: Fri, 24 Jul 2026 06:33:19 +0200 Subject: [PATCH] Added mouse drag to move debug camera. --- src/debug.odin | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/debug.odin b/src/debug.odin index b20d809..a468071 100644 --- a/src/debug.odin +++ b/src/debug.odin @@ -1,12 +1,13 @@ package game +import "core:fmt" import rl "vendor:raylib" Debug :: struct { - active: bool, - bounds_active: bool, - camera_active: bool, - camera: rl.Camera2D, + active: bool, + bounds_active: bool, + camera_active: bool, + camera: rl.Camera2D, } debug_init :: proc(game: ^Game) { @@ -65,6 +66,12 @@ debug_camera_update :: proc(debug: ^Debug) { debug.camera.zoom += scroll * 0.1 } } + + if rl.IsMouseButtonDown(.RIGHT) { + sensitivity: f32 = 0.32 + mouse_move := rl.GetMouseDelta() + debug.camera.target -= ((mouse_move * sensitivity) / debug.camera.zoom) + } } }