Fix mouse input example

This commit is contained in:
Not-Nik 2020-11-29 11:51:56 +01:00
parent 8ae2cefd4c
commit 1e4b02ad1b
No known key found for this signature in database
GPG Key ID: 08BB71E672DB3BFD

View File

@ -28,6 +28,8 @@ pub fn main() anyerror!void
// Update // Update
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
ballPosition = GetMousePosition(); ballPosition = GetMousePosition();
ballPosition.x = @intToFloat(f32, GetMouseX());
ballPosition.y = @intToFloat(f32, GetMouseY());
if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON)) { ballColor = MAROON; } if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON)) { ballColor = MAROON; }
else if (IsMouseButtonPressed(MouseButton.MOUSE_MIDDLE_BUTTON)) { ballColor = LIME; } else if (IsMouseButtonPressed(MouseButton.MOUSE_MIDDLE_BUTTON)) { ballColor = LIME; }