Añadido bisel a las notificaciones

This commit is contained in:
2022-12-29 11:00:26 +01:00
parent ec8209265a
commit 510a6ca718

View File

@@ -201,14 +201,27 @@ void Notify::showText(std::string text1, std::string text2)
n.texture->createBlank(renderer, width, height, SDL_TEXTUREACCESS_TARGET); n.texture->createBlank(renderer, width, height, SDL_TEXTUREACCESS_TARGET);
n.texture->setAsRenderTarget(renderer); n.texture->setAsRenderTarget(renderer);
SDL_SetRenderDrawColor(renderer, bgColor.r, bgColor.g, bgColor.b, 255); SDL_SetRenderDrawColor(renderer, bgColor.r, bgColor.g, bgColor.b, 255);
SDL_RenderClear(renderer); // SDL_RenderClear(renderer);
SDL_Rect rect;
rect = {padding, 0, width - (padding * 2), height};
SDL_RenderFillRect(renderer, &rect);
rect = {padding / 2, 1, width - padding, height - 2};
SDL_RenderFillRect(renderer, &rect);
rect = {1, padding / 2, width - 2, height - padding};
SDL_RenderFillRect(renderer, &rect);
rect = {0, padding, width, height - (padding * 2)};
SDL_RenderFillRect(renderer, &rect);
sp->render(); sp->render();
n.texture->setBlendMode(SDL_BLENDMODE_BLEND); n.texture->setBlendMode(SDL_BLENDMODE_BLEND);
color_t color = {255, 255, 255}; color_t color = {255, 255, 255};
if (text2 != "") if (text2 != "")
{ // Dos lineas de texto { // Dos lineas de texto
text->writeColored(padding + 16 + 4, padding, text1, color); text->writeColored(padding + 16 + 4, padding, text1, color);
text->writeColored(padding + 16 + 4, padding + text->getCharacterSize(), text2, color); text->writeColored(padding + 16 + 4, padding + text->getCharacterSize() + 1, text2, color);
} }
else else
{ // Una linea de texto { // Una linea de texto