PROG_3B/src/menu.cpp
2025-12-08 16:04:03 +01:00

33 lines
869 B
C++

#include "menu.h"
MenuResult DrawMenu() {
Rectangle b1 = { 250, 180, 300, 50 };
Rectangle b2 = { 250, 260, 300, 50 };
Rectangle b3 = { 250, 340, 300, 50 };
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Wähle Anzahl Paare:", 200, 100, 30, DARKGRAY);
DrawRectangleRec(b1, LIGHTGRAY);
DrawText("3 Paare", 340, 195, 20, BLACK);
DrawRectangleRec(b2, LIGHTGRAY);
DrawText("6 Paare", 340, 275, 20, BLACK);
DrawRectangleRec(b3, LIGHTGRAY);
DrawText("9 Paare", 340, 355, 20, BLACK);
EndDrawing();
Vector2 m = GetMousePosition();
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) {
if (CheckCollisionPointRec(m, b1)) return MENU_SELECT_3;
if (CheckCollisionPointRec(m, b2)) return MENU_SELECT_6;
if (CheckCollisionPointRec(m, b3)) return MENU_SELECT_9;
}
return MENU_NONE;
}