marcador provisional
This commit is contained in:
@@ -144,6 +144,13 @@ void Console::redrawText() {
|
||||
SDL_FRect rect = {.x = 0, .y = 0, .w = WIDTH, .h = height_};
|
||||
surface_->drawRectBorder(&rect, BORDER_COLOR);
|
||||
|
||||
// La surface de la fuente tiene transparent_color_=255 por defecto,
|
||||
// pero sus píxeles de fondo son color 0. Cambiarlo temporalmente a 0
|
||||
// para que no pinte el fondo negro de los glyphs sobre la consola.
|
||||
auto* font_surface = text_->getSprite()->getSurface().get();
|
||||
const Uint8 PREV_TRANSPARENT = font_surface->getTransparentColor();
|
||||
font_surface->setTransparentColor(0);
|
||||
|
||||
// Líneas de mensaje con efecto typewriter (solo muestra los primeros typewriter_chars_)
|
||||
int y_pos = PADDING_IN_V;
|
||||
int remaining = typewriter_chars_;
|
||||
@@ -160,6 +167,9 @@ void Console::redrawText() {
|
||||
const std::string INPUT_STR = prompt_ + input_line_ + (SHOW_CURSOR ? "_" : "");
|
||||
text_->writeColored(PADDING_IN_H, y_pos, INPUT_STR, BORDER_COLOR);
|
||||
|
||||
// Restaurar transparent_color_ original de la fuente
|
||||
font_surface->setTransparentColor(PREV_TRANSPARENT);
|
||||
|
||||
Screen::get()->setRendererSurface(previous_renderer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user