Finalitzada la part de entrar nom. Falta posar un temporitzador i una animació

This commit is contained in:
2024-09-30 19:35:41 +02:00
parent 6acf0b7efc
commit 0af441b5df
5 changed files with 25 additions and 19 deletions

View File

@@ -309,26 +309,24 @@ void Scoreboard::fillPanelTextures()
// ENTER NAME
textScoreBoard->writeCentered(slot4_3.x, slot4_3.y, lang::getText(106));
//color_t selectorColor = lightenColor(color, 36);
color_t textColor = {0xFB, 0xF2, 0x36};
SDL_Rect rect = {enterNamePos.x, enterNamePos.y, 8, 8};
SDL_Rect rect = {enterNamePos.x, enterNamePos.y, 5, 7};
SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xEB, 255);
for (int j = 0; j < (int)recordName[i].size(); ++j)
{
SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 255);
SDL_RenderDrawLine(renderer, rect.x + 1, rect.y + rect.h + 1, rect.x + rect.w - 2, rect.y + rect.h + 1);
if (j == selectorPos[i])
{
// SDL_SetRenderDrawColor(renderer, selectorColor.r, selectorColor.g, selectorColor.b, 255);
// SDL_RenderFillRect(renderer, &rect);
SDL_SetRenderDrawColor(renderer, textColor.r, textColor.g, textColor.b, 255);
SDL_RenderDrawLine(renderer, rect.x + 1, rect.y + rect.h + 1, rect.x + rect.w - 2, rect.y + rect.h + 1);
textScoreBoard->writeColored(rect.x + 1, rect.y + 1, recordName[i].substr(j, 1), textColor);
{// La letra seleccionada se pinta de forma intermitente
if (counter % 3 > 0)
{
SDL_RenderDrawLine(renderer, rect.x, rect.y + rect.h, rect.x + rect.w, rect.y + rect.h);
textScoreBoard->write(rect.x, rect.y, recordName[i].substr(j, 1));
}
}
else
{
textScoreBoard->write(rect.x + 1, rect.y + 1, recordName[i].substr(j, 1));
SDL_RenderDrawLine(renderer, rect.x, rect.y + rect.h, rect.x + rect.w, rect.y + rect.h);
textScoreBoard->write(rect.x, rect.y, recordName[i].substr(j, 1));
}
rect.x += 8;
rect.x += 7;
}
break;
}
@@ -402,9 +400,9 @@ void Scoreboard::recalculateAnchors()
slot4_4 = {col, row4};
// Primer cuadrado para poner el nombre de record
const int enterNameLenght = 8 * 8;
const int enterNameLenght = 8 * 7;
enterNamePos.x = (panelWidth - enterNameLenght) / 2;
enterNamePos.y = row4 - 1;
enterNamePos.y = row4;
// Recoloca los sprites
if (powerMeterSprite)