-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.IsMouseButtonDown
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Check if a mouse button is being pressed
| Parameter | Default Value | Note |
|---|---|---|
| button |
| Condition | Return Value |
|---|---|
| (always) | number |
raylib.InitWindow 800, 600, "Mouse Button Down Demo"
while not raylib.WindowShouldClose
raylib.BeginDrawing
raylib.ClearBackground color.white
if raylib.IsMouseButtonDown(raylib.MOUSE_BUTTON_LEFT) then
raylib.DrawText "Left button held", 10, 10, 20, color.red
else
raylib.DrawText "Click and hold the left button", 10, 10, 20, color.black
end if
raylib.EndDrawing
end while
raylib.CloseWindow