Added mouse drag to move debug camera.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package game
|
package game
|
||||||
|
|
||||||
|
import "core:fmt"
|
||||||
import rl "vendor:raylib"
|
import rl "vendor:raylib"
|
||||||
|
|
||||||
Debug :: struct {
|
Debug :: struct {
|
||||||
@@ -65,6 +66,12 @@ debug_camera_update :: proc(debug: ^Debug) {
|
|||||||
debug.camera.zoom += scroll * 0.1
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user