Fix mouse input example
This commit is contained in:
parent
8ae2cefd4c
commit
1e4b02ad1b
1 changed files with 2 additions and 0 deletions
|
|
@ -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; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue