varies millores en el hud de debug

This commit is contained in:
2026-03-11 23:27:02 +01:00
parent dfbd8a430b
commit cbe6dc9744
4 changed files with 78 additions and 119 deletions

View File

@@ -313,6 +313,17 @@ void TextRenderer::printAbsolute(int physical_x, int physical_y, const std::stri
printAbsolute(physical_x, physical_y, text.c_str(), color);
}
void TextRenderer::printAbsoluteShadowed(int physical_x, int physical_y, const char* text) {
// Sombra: negro semitransparente desplazado 1px
printAbsolute(physical_x + 1, physical_y + 1, text, {0, 0, 0, 180});
// Texto: blanco opaco
printAbsolute(physical_x, physical_y, text, {255, 255, 255, 255});
}
void TextRenderer::printAbsoluteShadowed(int physical_x, int physical_y, const std::string& text) {
printAbsoluteShadowed(physical_x, physical_y, text.c_str());
}
int TextRenderer::getTextWidth(const char* text) {
if (!isInitialized() || text == nullptr) {
return 0;

View File

@@ -31,6 +31,10 @@ public:
void printAbsolute(int physical_x, int physical_y, const char* text, SDL_Color color);
void printAbsolute(int physical_x, int physical_y, const std::string& text, SDL_Color color);
// Renderiza texto con sombra negra (+1px offset) para máxima legibilidad sobre cualquier fondo
void printAbsoluteShadowed(int physical_x, int physical_y, const char* text);
void printAbsoluteShadowed(int physical_x, int physical_y, const std::string& text);
// Obtiene el ancho de un texto renderizado (en píxeles lógicos para compatibilidad)
int getTextWidth(const char* text);