Trabajando en el marcador
This commit is contained in:
@@ -43,6 +43,17 @@ void ScoreBoard::fillTexture()
|
||||
SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0x00);
|
||||
SDL_RenderClear(renderer);
|
||||
|
||||
// Pinta el degradado
|
||||
const float num_lines = (SCOREBOARD_BOTTOM / 2) - SCOREBOARD_TOP;
|
||||
|
||||
for (int i = SCOREBOARD_TOP; i < SCOREBOARD_TOP + num_lines; i++)
|
||||
{
|
||||
float step = ((float)i / num_lines);
|
||||
int alpha = 64 + ((0 - 64) * step);
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, alpha);
|
||||
SDL_RenderDrawLine(renderer, SCOREBOARD_LEFT, i, SCOREBOARD_RIGHT, i);
|
||||
}
|
||||
|
||||
// Escribe los textos
|
||||
text->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_FIRST_QUARTER_X, 8, "-LIVES-");
|
||||
text->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_FIRST_QUARTER_X, 8 + text->getCharacterSize(), std::to_string(board->lives));
|
||||
|
||||
Reference in New Issue
Block a user