fixed main menu background

This commit is contained in:
2025-12-06 15:44:05 +01:00
parent f24d484496
commit f086ed3021
2 changed files with 88 additions and 13 deletions

View File

@ -53,6 +53,16 @@ void UIRenderer::drawButton(SDL_Renderer* renderer, FontAtlas* font, float cx, f
bgColor.a};
}
// Neon glow aura around the button to increase visibility (subtle)
SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND);
for (int gi = 0; gi < 3; ++gi) {
float grow = 6.0f + gi * 3.0f;
Uint8 glowA = static_cast<Uint8>(std::max(0, (int)borderColor.a / (3 - gi)));
SDL_SetRenderDrawColor(renderer, borderColor.r, borderColor.g, borderColor.b, glowA);
SDL_FRect glowRect{x - grow, y - grow, w + grow * 2.0f, h + grow * 2.0f};
SDL_RenderRect(renderer, &glowRect);
}
// Draw button background with border
SDL_SetRenderDrawColor(renderer, borderColor.r, borderColor.g, borderColor.b, borderColor.a);
SDL_FRect borderRect{x - 2, y - 2, w + 4, h + 4};