Añadir tema RGB y actualizar documentación completa
- Añadido nuevo tema RGB con fondo blanco puro y colores matemáticos - Actualizado README.md con controles actuales y nuevas características - Reorganizada documentación de controles por categorías - Corregida información obsoleta (resolución, temas, problemas) - Añadido control KP_5 para selección directa del tema RGB - Mejorada visibilidad del texto adaptando colores por tema 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -199,7 +199,7 @@ void Engine::handleEvents() {
|
||||
|
||||
case SDLK_T:
|
||||
// Ciclar al siguiente tema
|
||||
current_theme_ = static_cast<ColorTheme>((static_cast<int>(current_theme_) + 1) % 4);
|
||||
current_theme_ = static_cast<ColorTheme>((static_cast<int>(current_theme_) + 1) % (sizeof(themes_) / sizeof(themes_[0])));
|
||||
initBalls(scenario_); // Regenerar bolas con nueva paleta
|
||||
break;
|
||||
|
||||
@@ -224,6 +224,11 @@ void Engine::handleEvents() {
|
||||
initBalls(scenario_);
|
||||
break;
|
||||
|
||||
case SDLK_KP_5:
|
||||
current_theme_ = ColorTheme::RGB;
|
||||
initBalls(scenario_);
|
||||
break;
|
||||
|
||||
case SDLK_1:
|
||||
scenario_ = 0;
|
||||
initBalls(scenario_);
|
||||
@@ -313,22 +318,26 @@ void Engine::render() {
|
||||
}
|
||||
|
||||
if (show_text_) {
|
||||
dbg_print(text_pos_, 8, text_.c_str(), 255, 255, 255);
|
||||
|
||||
// Mostrar nombre del tema en castellano debajo del número de pelotas
|
||||
std::string theme_names_es[] = {"ATARDECER", "OCEANO", "NEON", "BOSQUE"};
|
||||
std::string theme_name = theme_names_es[static_cast<int>(current_theme_)];
|
||||
int theme_text_width = static_cast<int>(theme_name.length() * 8); // 8 píxeles por carácter
|
||||
int theme_x = (current_screen_width_ - theme_text_width) / 2; // Centrar horizontalmente
|
||||
|
||||
// Colores acordes a cada tema
|
||||
// Colores acordes a cada tema (para texto del número de pelotas y nombre del tema)
|
||||
int theme_colors[][3] = {
|
||||
{255, 140, 60}, // ATARDECER: Naranja cálido
|
||||
{80, 200, 255}, // OCEANO: Azul océano
|
||||
{255, 60, 255}, // NEON: Magenta brillante
|
||||
{100, 255, 100} // BOSQUE: Verde natural
|
||||
{100, 255, 100}, // BOSQUE: Verde natural
|
||||
{100, 100, 100} // RGB: Gris oscuro (para contraste con fondo blanco)
|
||||
};
|
||||
int theme_idx = static_cast<int>(current_theme_);
|
||||
|
||||
// Texto del número de pelotas con color del tema
|
||||
dbg_print(text_pos_, 8, text_.c_str(), theme_colors[theme_idx][0], theme_colors[theme_idx][1], theme_colors[theme_idx][2]);
|
||||
|
||||
// Mostrar nombre del tema en castellano debajo del número de pelotas
|
||||
std::string theme_names_es[] = {"ATARDECER", "OCEANO", "NEON", "BOSQUE", "RGB"};
|
||||
std::string theme_name = theme_names_es[static_cast<int>(current_theme_)];
|
||||
int theme_text_width = static_cast<int>(theme_name.length() * 8); // 8 píxeles por carácter
|
||||
int theme_x = (current_screen_width_ - theme_text_width) / 2; // Centrar horizontalmente
|
||||
|
||||
// Texto del nombre del tema con el mismo color
|
||||
dbg_print(theme_x, 24, theme_name.c_str(), theme_colors[theme_idx][0], theme_colors[theme_idx][1], theme_colors[theme_idx][2]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user