Fix core_input_gamepad_info example so all buttons are displayed within the window

This commit is contained in:
asdqwe 2024-08-08 19:48:38 -03:00
parent 97c02b2425
commit fbad8eb8f1

View File

@ -47,25 +47,25 @@ int main(void)
ClearBackground(RAYWHITE); ClearBackground(RAYWHITE);
for (int i = 0, y = 10; i < 4; i++) // MAX_GAMEPADS = 4 for (int i = 0, y = 5; i < 4; i++) // MAX_GAMEPADS = 4
{ {
if (IsGamepadAvailable(i)) if (IsGamepadAvailable(i))
{ {
DrawText(TextFormat("Gamepad name: %s", GetGamepadName(i)), 10, y, 20, BLACK); DrawText(TextFormat("Gamepad name: %s", GetGamepadName(i)), 10, y, 10, BLACK);
y += 30; y += 11;
DrawText(TextFormat("\tAxis count: %d", GetGamepadAxisCount(i)), 10, y, 20, BLACK); DrawText(TextFormat("\tAxis count: %d", GetGamepadAxisCount(i)), 10, y, 10, BLACK);
y += 30; y += 11;
for (int axis = 0; axis < GetGamepadAxisCount(i); axis++) for (int axis = 0; axis < GetGamepadAxisCount(i); axis++)
{ {
DrawText(TextFormat("\tAxis %d = %f", axis, GetGamepadAxisMovement(i, axis)), 10, y, 20, BLACK); DrawText(TextFormat("\tAxis %d = %f", axis, GetGamepadAxisMovement(i, axis)), 10, y, 10, BLACK);
y += 30; y += 11;
} }
for (int button = 0; button < 32; button++) for (int button = 0; button < 32; button++)
{ {
DrawText(TextFormat("\tButton %d = %d", button, IsGamepadButtonDown(i, button)), 10, y, 20, BLACK); DrawText(TextFormat("\tButton %d = %d", button, IsGamepadButtonDown(i, button)), 10, y, 10, BLACK);
y += 30; y += 11;
} }
} }
} }