-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.IsGamepadAvailable
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Check if a gamepad is available
| Parameter | Default Value | Note |
|---|---|---|
| gamepad | 0 |
| Condition | Return Value |
|---|---|
| (always) | number |
raylib.InitWindow 800, 600, "Gamepad Demo"
while not raylib.WindowShouldClose
raylib.BeginDrawing
raylib.ClearBackground color.white
if raylib.IsGamepadAvailable(0) then
raylib.DrawText "Gamepad 0 connected", 10, 10, 20, color.green
else
raylib.DrawText "No gamepad detected", 10, 10, 20, color.red
end if
raylib.EndDrawing
end while
raylib.CloseWindow