Added mouse drag to move debug camera.

This commit is contained in:
2026-07-24 06:33:19 +02:00
parent 92717d3aef
commit fe14f2723c
+11 -4
View File
@@ -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)
}
}
}