Cambio de color en el texto del marcador

This commit is contained in:
2022-09-13 09:49:40 +02:00
parent b8fe11fb63
commit 464d8194d4
6 changed files with 28 additions and 16 deletions

View File

@@ -104,7 +104,7 @@ void ScoreBoard::render()
// Muestra si suena la música
if (board->music)
{
const color_t c = stringToColor("bright_blue");
const color_t c = board->color;
SDL_Rect clip = {0, 8, 8, 8};
itemTexture->setColor(c.r, c.g, c.b);
itemTexture->render(renderer, 20 * BLOCK, line2, &clip);
@@ -113,14 +113,14 @@ void ScoreBoard::render()
// Escribe los textos
const std::string timeTxt = std::to_string((clock.minutes % 60) / 10) + std::to_string(clock.minutes % 10) + clock.separator + std::to_string((clock.seconds % 60) / 10) + std::to_string(clock.seconds % 10);
const std::string itemsTxt = std::to_string(board->items / 100) + std::to_string((board->items % 100) / 10) + std::to_string(board->items % 10);
this->text->writeColored(BLOCK, line1, "Items collected ", stringToColor("yellow"));
this->text->writeColored(17 * BLOCK, line1, itemsTxt, stringToColor("bright_blue"));
this->text->writeColored(20 * BLOCK, line1, " Time ", stringToColor("yellow"));
this->text->writeColored(26 * BLOCK, line1, timeTxt, stringToColor("bright_blue"));
this->text->writeColored(BLOCK, line1, "Items collected ", board->color);
this->text->writeColored(17 * BLOCK, line1, itemsTxt, stringToColor("white"));
this->text->writeColored(20 * BLOCK, line1, " Time ", board->color);
this->text->writeColored(26 * BLOCK, line1, timeTxt, stringToColor("white"));
const std::string roomsTxt = std::to_string(board->rooms / 100) + std::to_string((board->rooms % 100) / 10) + std::to_string(board->rooms % 10);
this->text->writeColored(22 * BLOCK, line2, "Rooms", stringToColor("yellow"));
this->text->writeColored(28 * BLOCK, line2, roomsTxt, stringToColor("bright_blue"));
this->text->writeColored(22 * BLOCK, line2, "Rooms", stringToColor("white"));
this->text->writeColored(28 * BLOCK, line2, roomsTxt, stringToColor("white"));
}
// Actualiza las variables del objeto