58 const float buttonWidth = 180.0f;
59 const float buttonHeight = 50.0f;
60 const float margin = 20.0f;
65 startGamePtr->SetSize(buttonWidth, buttonHeight);
67 float centerX = (screenWidth - buttonWidth) / 2.0f;
68 startGamePtr->SetPosition(centerX, screenHeight - margin - buttonHeight);
69 startGamePtr->SetText(
"START GAME");
70 startGamePtr->SetBackgroundColor(0xFF4CAF50);
71 startGamePtr->SetHoverColor(0xFF66BB6A);
72 startGamePtr->SetTextColor(0xFFFFFFFF);
81 backPtr->SetSize(buttonWidth, buttonHeight);
82 backPtr->SetPosition(margin, screenHeight - margin - buttonHeight);
83 backPtr->SetText(
"BACK");
84 backPtr->SetBackgroundColor(0xFF424242);
85 backPtr->SetHoverColor(0xFF616161);
86 backPtr->SetTextColor(0xFFFFFFFF);
110 const char *title =
"Waiting for Game Start";
111 int titleFontSize = 36;
112 int titleWidth =
static_cast<int>(strlen(title) * titleFontSize * 0.5f);
113 int titleX = (screenWidth - titleWidth) / 2;
119 int infoFontSize = 20;
120 int infoWidth =
static_cast<int>(roomInfo.length() * infoFontSize * 0.5f);
121 int infoX = (screenWidth - infoWidth) / 2;
128 float playerY = 160.0f;
129 int playerFontSize = 18;
130 int playerBoxHeight = 40;
131 int playerBoxWidth = 400;
133 for (
size_t i = 0; i <
_players.size(); ++i) {
137 uint32_t backgroundColor =
138 player.isHost ? 0xFFFFD700 : 0xFF505050;
140 player.isHost ? 0xFF000000 : 0xFFFFFFFF;
145 _graphics.
DrawRect(50,
static_cast<int>(playerY), playerBoxWidth, playerBoxHeight, 0xFF888888);
148 std::string playerLabel = player.playerName;
150 playerLabel +=
" (HOST)";
152 if (player.isSpectator) {
153 playerLabel +=
" [SPECTATOR]";
156 _graphics.
DrawText(playerLabel.c_str(), 60,
static_cast<int>(playerY) + 10, playerFontSize,
159 playerY += playerBoxHeight + 10;
virtual void DrawText(int fontHandle, const char *text, int x, int y, int fontSize, unsigned int color)=0
Draw text using a loaded font.
virtual void DrawRect(int x, int y, int width, int height, unsigned int color)=0
Draw a rectangle outline.