Parametritzant colorets de varios llocs
This commit is contained in:
@@ -21,13 +21,17 @@ fade.venetian_size 12
|
||||
|
||||
## --- SCOREBOARD ---
|
||||
scoreboard.rect.x 0
|
||||
scoreboard.rect.y 200
|
||||
scoreboard.rect.y 216
|
||||
scoreboard.rect.w 320
|
||||
scoreboard.rect.h 40
|
||||
scoreboard.separator_color 0D1A2B
|
||||
scoreboard.easy_color 4B692F
|
||||
scoreboard.normal_color 2E3F47
|
||||
scoreboard.hard_color 76428A
|
||||
scoreboard.separator_autocolor true
|
||||
scoreboard.separator_color 0D1A2B
|
||||
scoreboard.easy_color 4B692F
|
||||
scoreboard.normal_color 2E3F47
|
||||
scoreboard.hard_color 76428A
|
||||
scoreboard.text_autocolor true
|
||||
scoreboard.text_color1 FFFFFF
|
||||
scoreboard.text_color2 FFFFFF
|
||||
|
||||
## --- TITLE ---
|
||||
title.press_start_position 170
|
||||
@@ -36,8 +40,7 @@ title.arcade_edition_position 123
|
||||
title.title_c_c_position 80
|
||||
|
||||
## --- BACKGROUND ---
|
||||
background.attenuate_color FFFFFF
|
||||
background.attenuate_alpha 0
|
||||
background.attenuate_color FFFFFF00
|
||||
|
||||
## --- BALLOONS ---
|
||||
balloon_1.vel 2.75f
|
||||
|
||||
@@ -24,10 +24,14 @@ scoreboard.rect.x 0
|
||||
scoreboard.rect.y 216
|
||||
scoreboard.rect.w 320
|
||||
scoreboard.rect.h 40
|
||||
scoreboard.separator_color 0D1A2B
|
||||
scoreboard.easy_color 4B692F
|
||||
scoreboard.normal_color 2E3F47
|
||||
scoreboard.hard_color 76428A
|
||||
scoreboard.separator_autocolor true
|
||||
scoreboard.separator_color 0D1A2B
|
||||
scoreboard.easy_color 4B692F
|
||||
scoreboard.normal_color 2E3F47
|
||||
scoreboard.hard_color 76428A
|
||||
scoreboard.text_autocolor true
|
||||
scoreboard.text_color1 FFFFFF
|
||||
scoreboard.text_color2 FFFFFF
|
||||
|
||||
## --- TITLE ---
|
||||
title.press_start_position 180
|
||||
@@ -36,8 +40,7 @@ title.arcade_edition_position 123
|
||||
title.title_c_c_position 80
|
||||
|
||||
## --- BACKGROUND ---
|
||||
background.attenuate_color FFFFFF
|
||||
background.attenuate_alpha 0
|
||||
background.attenuate_color FFFFFF00
|
||||
|
||||
## --- BALLOONS ---
|
||||
balloon_1.vel 2.75f
|
||||
@@ -59,5 +62,5 @@ notification.color 303030
|
||||
service_menu.title_color 99FF62
|
||||
service_menu.text_color FFFFFF
|
||||
service_menu.selected_color FFDC44
|
||||
service_menu.bg_color 111100F0
|
||||
service_menu.bg_color 000000F0
|
||||
service_menu.drop_shadow false
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 145 B |
@@ -28,8 +28,8 @@ Background::Background()
|
||||
dst_rect_({0, 0, 320, 240}),
|
||||
base_(rect_.h),
|
||||
attenuate_color_(Color(param.background.attenuate_color.r, param.background.attenuate_color.g, param.background.attenuate_color.b)),
|
||||
alpha_color_text_(param.background.attenuate_alpha),
|
||||
alpha_color_text_temp_(param.background.attenuate_alpha)
|
||||
alpha_color_text_(param.background.attenuate_color.a),
|
||||
alpha_color_text_temp_(param.background.attenuate_color.a)
|
||||
|
||||
{
|
||||
// Precalcula rutas
|
||||
|
||||
@@ -221,13 +221,13 @@ void HiScoreTable::createSprites()
|
||||
const int first_line = (param.game.height - size) / 2;
|
||||
|
||||
// Crea el sprite para el texto de cabecera
|
||||
header_ = std::make_unique<Sprite>(header_text->writeDXToTexture(TEXT_COLOR, Lang::getText("[HIGHSCORE_TABLE] CAPTION"), -2, background_fade_color_.getInverse().lighten(25)));
|
||||
header_ = std::make_unique<Sprite>(header_text->writeDXToTexture(TEXT_COLOR, Lang::getText("[HIGHSCORE_TABLE] CAPTION"), -2, background_fade_color_.inverse().lighten(25)));
|
||||
header_->setPosition(param.game.game_area.center_x - (header_->getWidth() / 2), first_line);
|
||||
|
||||
// Crea los sprites para las entradas en la tabla de puntuaciones
|
||||
const int animation = rand() % 4;
|
||||
const std::string sample_line(ENTRY_LENGHT + 3, ' ');
|
||||
auto sample_entry = std::make_unique<Sprite>(entry_text->writeDXToTexture(TEXT_SHADOW, sample_line, 1, ORANGE_COLOR, 1, SHADOW_TEXT_COLOR));
|
||||
auto sample_entry = std::make_unique<Sprite>(entry_text->writeDXToTexture(TEXT_SHADOW, sample_line, 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR));
|
||||
const auto entry_width = sample_entry->getWidth();
|
||||
for (int i = 0; i < MAX_NAMES; ++i)
|
||||
{
|
||||
@@ -242,7 +242,7 @@ void HiScoreTable::createSprites()
|
||||
}
|
||||
const auto line = table_position + Options::settings.hi_score_table.at(i).name + dots + score + one_cc;
|
||||
|
||||
entry_names_.emplace_back(std::make_shared<PathSprite>(entry_text->writeDXToTexture(TEXT_SHADOW, line, 1, ORANGE_COLOR, 1, SHADOW_TEXT_COLOR)));
|
||||
entry_names_.emplace_back(std::make_shared<PathSprite>(entry_text->writeDXToTexture(TEXT_SHADOW, line, 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR)));
|
||||
const int default_pos_x = (backbuffer_width - entry_width) / 2;
|
||||
const int pos_x = (i < 9) ? default_pos_x : default_pos_x - entry_text->getCharacterSize();
|
||||
const int pos_y = (i * space_between_lines) + first_line + space_between_header;
|
||||
@@ -392,10 +392,10 @@ Color HiScoreTable::getEntryColor(int counter_)
|
||||
void HiScoreTable::iniEntryColors()
|
||||
{
|
||||
entry_colors_.clear();
|
||||
entry_colors_.emplace_back(background_fade_color_.getInverse().lighten(75));
|
||||
entry_colors_.emplace_back(background_fade_color_.getInverse().lighten(50));
|
||||
entry_colors_.emplace_back(background_fade_color_.getInverse().lighten(25));
|
||||
entry_colors_.emplace_back(background_fade_color_.getInverse());
|
||||
entry_colors_.emplace_back(background_fade_color_.inverse().lighten(75));
|
||||
entry_colors_.emplace_back(background_fade_color_.inverse().lighten(50));
|
||||
entry_colors_.emplace_back(background_fade_color_.inverse().lighten(25));
|
||||
entry_colors_.emplace_back(background_fade_color_.inverse());
|
||||
}
|
||||
|
||||
// Hace brillar los nombres de la tabla de records
|
||||
|
||||
@@ -153,6 +153,8 @@ void Instructions::fillTexture()
|
||||
}
|
||||
const int ANCHOR_ITEM = (param.game.width - (lenght + desp_x)) / 2;
|
||||
|
||||
constexpr Color ORANGE_COLOR = Color(0XFF, 0X7A, 0X00);
|
||||
|
||||
// Escribe el texto de las instrucciones
|
||||
text_->writeDX(TEXT_CENTER | TEXT_COLOR | TEXT_SHADOW, param.game.game_area.center_x, first_line, Lang::getText("[INSTRUCTIONS] 01"), 1, ORANGE_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ void initParam()
|
||||
|
||||
// BACKGROUND
|
||||
param.background.attenuate_color = Color(255, 255, 255);
|
||||
param.background.attenuate_alpha = 32;
|
||||
|
||||
// BALLOONS
|
||||
param.balloon.emplace_back(0.09f, 2.60f);
|
||||
@@ -223,6 +222,11 @@ bool setParams(const std::string &var, const std::string &value)
|
||||
param.scoreboard.rect.h = std::stoi(value);
|
||||
}
|
||||
|
||||
else if (var == "scoreboard.separator_autocolor")
|
||||
{
|
||||
param.scoreboard.separator_autocolor = stringToBool(value);
|
||||
}
|
||||
|
||||
else if (var == "scoreboard.separator_color")
|
||||
{
|
||||
param.scoreboard.separator_color = Color::fromHex(value);
|
||||
@@ -243,6 +247,21 @@ bool setParams(const std::string &var, const std::string &value)
|
||||
param.scoreboard.hard_color = Color::fromHex(value);
|
||||
}
|
||||
|
||||
else if (var == "scoreboard.text_autocolor")
|
||||
{
|
||||
param.scoreboard.text_autocolor = stringToBool(value);
|
||||
}
|
||||
|
||||
else if (var == "scoreboard.text_color1")
|
||||
{
|
||||
param.scoreboard.text_color1 = Color::fromHex(value);
|
||||
}
|
||||
|
||||
else if (var == "scoreboard.text_color2")
|
||||
{
|
||||
param.scoreboard.text_color2 = Color::fromHex(value);
|
||||
}
|
||||
|
||||
// TITLE
|
||||
else if (var == "title.press_start_position")
|
||||
{
|
||||
@@ -270,11 +289,6 @@ bool setParams(const std::string &var, const std::string &value)
|
||||
param.background.attenuate_color = Color::fromHex(value);
|
||||
}
|
||||
|
||||
else if (var == "background.attenuate_alpha")
|
||||
{
|
||||
param.background.attenuate_alpha = std::stoi(value);
|
||||
}
|
||||
|
||||
// BALLOON
|
||||
else if (var == "balloon_1.vel")
|
||||
{
|
||||
|
||||
@@ -45,7 +45,6 @@ struct ParamTitle
|
||||
struct ParamBackground
|
||||
{
|
||||
Color attenuate_color; // Color para atenuar el fondo
|
||||
int attenuate_alpha; // Alpha para la atenuación
|
||||
};
|
||||
|
||||
// --- Parámetros de los globos (balloons) ---
|
||||
@@ -71,11 +70,15 @@ struct ParamNotification
|
||||
// --- Parámetros del marcador ---
|
||||
struct ParamScoreboard
|
||||
{
|
||||
SDL_FRect rect; // Posición y tamaño del marcador
|
||||
Color separator_color; // Color del separador
|
||||
Color easy_color; // Color del marcador segun la dificultad
|
||||
Color normal_color; // Color del marcador segun la dificultad
|
||||
Color hard_color; // Color del marcador segun la dificultad
|
||||
SDL_FRect rect; // Posición y tamaño del marcador
|
||||
bool separator_autocolor; // El separado establece su color de forma automatica
|
||||
Color separator_color; // Color del separador si se pone de forma manual
|
||||
Color easy_color; // Color del marcador segun la dificultad
|
||||
Color normal_color; // Color del marcador segun la dificultad
|
||||
Color hard_color; // Color del marcador segun la dificultad
|
||||
bool text_autocolor; // El texto establece su color de forma automatica
|
||||
Color text_color1; // Color del texto
|
||||
Color text_color2; // Color del texto
|
||||
};
|
||||
|
||||
// --- Parámetros del menú de servicio ---
|
||||
|
||||
@@ -131,8 +131,15 @@ void Scoreboard::render()
|
||||
// Establece el valor de la variable
|
||||
void Scoreboard::setColor(Color color)
|
||||
{
|
||||
// Actualiza las variables de colores
|
||||
color_ = color;
|
||||
text_color1_ = param.scoreboard.text_autocolor ? color_.lighten(100) : param.scoreboard.text_color1;
|
||||
text_color2_ = param.scoreboard.text_autocolor ? color_.lighten(150) : param.scoreboard.text_color2;
|
||||
|
||||
// Aplica los colores
|
||||
power_meter_sprite_->getTexture()->setColor(text_color2_);
|
||||
fillBackgroundTexture();
|
||||
iniNameColors();
|
||||
}
|
||||
|
||||
// Establece el valor de la variable
|
||||
@@ -167,25 +174,25 @@ void Scoreboard::fillPanelTextures()
|
||||
case ScoreboardMode::SCORE:
|
||||
{
|
||||
// SCORE
|
||||
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y, name_[i]);
|
||||
text_scoreboard_->writeCentered(slot4_2_.x, slot4_2_.y, updateScoreText(score_[i]));
|
||||
text_scoreboard_->writeDX(TEXT_COLOR | TEXT_CENTER, slot4_1_.x, slot4_1_.y, name_[i], 1, text_color1_);
|
||||
text_scoreboard_->writeDX(TEXT_COLOR | TEXT_CENTER, slot4_2_.x, slot4_2_.y, updateScoreText(score_[i]), 1, text_color2_);
|
||||
|
||||
// MULT
|
||||
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, Lang::getText("[SCOREBOARD] 3"));
|
||||
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y, "x" + std::to_string(mult_[i]).substr(0, 3));
|
||||
text_scoreboard_->writeDX(TEXT_COLOR | TEXT_CENTER, slot4_3_.x, slot4_3_.y, Lang::getText("[SCOREBOARD] 3"), 1, text_color1_);
|
||||
text_scoreboard_->writeDX(TEXT_COLOR | TEXT_CENTER, slot4_4_.x, slot4_4_.y, "x" + std::to_string(mult_[i]).substr(0, 3), 1, text_color2_);
|
||||
break;
|
||||
}
|
||||
|
||||
case ScoreboardMode::DEMO:
|
||||
{
|
||||
// DEMO MODE
|
||||
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y + 4, Lang::getText("[SCOREBOARD] 6"));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_1_.x, slot4_1_.y + 4, Lang::getText("[SCOREBOARD] 6"), 1, text_color1_);
|
||||
|
||||
// PRESS START TO PLAY
|
||||
if (time_counter_ % 10 < 8)
|
||||
{
|
||||
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y - 2, Lang::getText("[SCOREBOARD] 8"));
|
||||
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y - 2, Lang::getText("[SCOREBOARD] 9"));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_3_.x, slot4_3_.y - 2, Lang::getText("[SCOREBOARD] 8"), 1, text_color1_);
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_4_.x, slot4_4_.y - 2, Lang::getText("[SCOREBOARD] 9"), 1, text_color1_);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -193,13 +200,13 @@ void Scoreboard::fillPanelTextures()
|
||||
case ScoreboardMode::WAITING:
|
||||
{
|
||||
// GAME OVER
|
||||
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y + 4, Lang::getText("[SCOREBOARD] 7"));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_1_.x, slot4_1_.y + 4, Lang::getText("[SCOREBOARD] 7"), 1, text_color1_);
|
||||
|
||||
// PRESS START TO PLAY
|
||||
if (time_counter_ % 10 < 8)
|
||||
{
|
||||
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y - 2, Lang::getText("[SCOREBOARD] 8"));
|
||||
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y - 2, Lang::getText("[SCOREBOARD] 9"));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_3_.x, slot4_3_.y - 2, Lang::getText("[SCOREBOARD] 8"), 1, text_color1_);
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_4_.x, slot4_4_.y - 2, Lang::getText("[SCOREBOARD] 9"), 1, text_color1_);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -207,13 +214,13 @@ void Scoreboard::fillPanelTextures()
|
||||
case ScoreboardMode::GAME_OVER:
|
||||
{
|
||||
// GAME OVER
|
||||
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y + 4, Lang::getText("[SCOREBOARD] 7"));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_1_.x, slot4_1_.y + 4, Lang::getText("[SCOREBOARD] 7"), 1, text_color1_);
|
||||
|
||||
// PLEASE WAIT
|
||||
if (time_counter_ % 10 < 8)
|
||||
{
|
||||
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y - 2, Lang::getText("[SCOREBOARD] 12"));
|
||||
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y - 2, Lang::getText("[SCOREBOARD] 13"));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_3_.x, slot4_3_.y - 2, Lang::getText("[SCOREBOARD] 12"), 1, text_color1_);
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_4_.x, slot4_4_.y - 2, Lang::getText("[SCOREBOARD] 13"), 1, text_color1_);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -221,7 +228,7 @@ void Scoreboard::fillPanelTextures()
|
||||
case ScoreboardMode::STAGE_INFO:
|
||||
{
|
||||
// STAGE
|
||||
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y, Lang::getText("[SCOREBOARD] 5") + std::to_string(stage_));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_1_.x, slot4_1_.y, Lang::getText("[SCOREBOARD] 5") + std::to_string(stage_), 1, text_color1_);
|
||||
|
||||
// POWERMETER
|
||||
power_meter_sprite_->setSpriteClip(0, 0, 40, 7);
|
||||
@@ -230,40 +237,40 @@ void Scoreboard::fillPanelTextures()
|
||||
power_meter_sprite_->render();
|
||||
|
||||
// HI-SCORE
|
||||
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, Lang::getText("[SCOREBOARD] 4"));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_3_.x, slot4_3_.y, Lang::getText("[SCOREBOARD] 4"), 1, text_color1_);
|
||||
const std::string name = hi_score_name_ == "" ? "" : hi_score_name_ + " - ";
|
||||
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y, name + updateScoreText(hi_score_));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_4_.x, slot4_4_.y, name + updateScoreText(hi_score_), 1, text_color2_);
|
||||
break;
|
||||
}
|
||||
|
||||
case ScoreboardMode::CONTINUE:
|
||||
{
|
||||
// SCORE
|
||||
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y, name_[i]);
|
||||
text_scoreboard_->writeCentered(slot4_2_.x, slot4_2_.y, updateScoreText(score_[i]));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_1_.x, slot4_1_.y, name_[i], 1, text_color1_);
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_2_.x, slot4_2_.y, updateScoreText(score_[i]), 1, text_color2_);
|
||||
|
||||
// CONTINUE
|
||||
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, Lang::getText("[SCOREBOARD] 10"));
|
||||
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y, std::to_string(continue_counter_[i]));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_3_.x, slot4_3_.y, Lang::getText("[SCOREBOARD] 10"), 1, text_color1_);
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_4_.x, slot4_4_.y, std::to_string(continue_counter_[i]), 1, text_color2_);
|
||||
break;
|
||||
}
|
||||
|
||||
case ScoreboardMode::ENTER_NAME:
|
||||
{
|
||||
// SCORE
|
||||
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y, name_[i]);
|
||||
text_scoreboard_->writeCentered(slot4_2_.x, slot4_2_.y, updateScoreText(score_[i]));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_1_.x, slot4_1_.y, name_[i], 1, text_color1_);
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_2_.x, slot4_2_.y, updateScoreText(score_[i]), 1, text_color2_);
|
||||
|
||||
// ENTER NAME
|
||||
{
|
||||
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, Lang::getText("[SCOREBOARD] 11"));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_3_.x, slot4_3_.y, Lang::getText("[SCOREBOARD] 11"), 1, text_color1_);
|
||||
SDL_FRect rect = {enter_name_pos_.x, enter_name_pos_.y, 5.0f, 7.0f};
|
||||
|
||||
// Recorre todos los slots de letras del nombre
|
||||
for (size_t j = 0; j < NAME_SIZE; ++j)
|
||||
{
|
||||
// Selecciona el color
|
||||
const Color color = j < selector_pos_[i] ? ORANGE_SOFT_COLOR.lighten() : Color(0xFF, 0xFF, 0xEB);
|
||||
const Color color = j < selector_pos_[i] ? text_color2_ : text_color1_;
|
||||
|
||||
if (j != selector_pos_[i] || time_counter_ % 3 == 0)
|
||||
{
|
||||
@@ -288,11 +295,11 @@ void Scoreboard::fillPanelTextures()
|
||||
case ScoreboardMode::SHOW_NAME:
|
||||
{
|
||||
// SCORE
|
||||
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y, name_[i]);
|
||||
text_scoreboard_->writeCentered(slot4_2_.x, slot4_2_.y, updateScoreText(score_[i]));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_1_.x, slot4_1_.y, name_[i], 1, text_color1_);
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_2_.x, slot4_2_.y, updateScoreText(score_[i]), 1, text_color2_);
|
||||
|
||||
// NAME
|
||||
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y, Lang::getText("[SCOREBOARD] 11"));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_3_.x, slot4_3_.y, Lang::getText("[SCOREBOARD] 11"), 1, text_color1_);
|
||||
/* TEXTO CENTRADO */
|
||||
// text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_4_.x, slot4_4_.y, record_name_[i], 1, getColorLikeKnightRider(name_colors_, loop_counter_ / 5));
|
||||
|
||||
@@ -303,13 +310,13 @@ void Scoreboard::fillPanelTextures()
|
||||
case ScoreboardMode::GAME_COMPLETED:
|
||||
{
|
||||
// GAME OVER
|
||||
text_scoreboard_->writeCentered(slot4_1_.x, slot4_1_.y + 4, Lang::getText("[SCOREBOARD] 7"));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_1_.x, slot4_1_.y + 4, Lang::getText("[SCOREBOARD] 7"), 1, text_color1_);
|
||||
|
||||
// SCORE
|
||||
if (time_counter_ % 10 < 8)
|
||||
{
|
||||
text_scoreboard_->writeCentered(slot4_3_.x, slot4_3_.y - 2, Lang::getText("[SCOREBOARD] 14"));
|
||||
text_scoreboard_->writeCentered(slot4_4_.x, slot4_4_.y - 2, updateScoreText(score_[i]));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_3_.x, slot4_3_.y - 2, Lang::getText("[SCOREBOARD] 14"), 1, text_color1_);
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_4_.x, slot4_4_.y - 2, updateScoreText(score_[i]), 1, text_color2_);
|
||||
}
|
||||
}
|
||||
default:
|
||||
@@ -366,10 +373,10 @@ void Scoreboard::recalculateAnchors()
|
||||
const int TEXT_HEIGHT = 7;
|
||||
|
||||
// Filas
|
||||
const float ROW1 = (ROW_SIZE * 0) + (TEXT_HEIGHT / 2);
|
||||
const float ROW2 = (ROW_SIZE * 1) + (TEXT_HEIGHT / 2) - 1;
|
||||
const float ROW3 = (ROW_SIZE * 2) + (TEXT_HEIGHT / 2) - 2;
|
||||
const float ROW4 = (ROW_SIZE * 3) + (TEXT_HEIGHT / 2) - 3;
|
||||
const float ROW1 = 1 + (ROW_SIZE * 0) + (TEXT_HEIGHT / 2);
|
||||
const float ROW2 = 1 + (ROW_SIZE * 1) + (TEXT_HEIGHT / 2) - 1;
|
||||
const float ROW3 = 1 + (ROW_SIZE * 2) + (TEXT_HEIGHT / 2) - 2;
|
||||
const float ROW4 = 1 + (ROW_SIZE * 3) + (TEXT_HEIGHT / 2) - 3;
|
||||
|
||||
// Columna
|
||||
const float COL = panel_width / 2;
|
||||
@@ -433,14 +440,15 @@ void Scoreboard::createPanelTextures()
|
||||
void Scoreboard::renderSeparator()
|
||||
{
|
||||
// Dibuja la linea que separa el marcador de la zona de juego
|
||||
SDL_SetRenderDrawColor(renderer_, param.scoreboard.separator_color.r, param.scoreboard.separator_color.g, param.scoreboard.separator_color.b, 255);
|
||||
auto color = param.scoreboard.separator_autocolor ? color_.darken() : param.scoreboard.separator_color;
|
||||
SDL_SetRenderDrawColor(renderer_, color.r, color.g, color.b, 255);
|
||||
SDL_RenderLine(renderer_, 0, 0, rect_.w, 0);
|
||||
}
|
||||
|
||||
// Inicializa el vector de colores para el nombre
|
||||
void Scoreboard::iniNameColors()
|
||||
{
|
||||
Color color = GREEN_COLOR;
|
||||
Color color = color_.inverse();
|
||||
|
||||
name_colors_.clear();
|
||||
name_colors_.emplace_back(color.lighten(50));
|
||||
|
||||
@@ -101,6 +101,9 @@ private:
|
||||
int loop_counter_ = 0; // Contador de bucle
|
||||
std::vector<Color> name_colors_; // Colores para destacar el nombre una vez introducido
|
||||
|
||||
// --- Variables de aspecto ---
|
||||
Color text_color1_, text_color2_; // Colores para los marcadores del texto;
|
||||
|
||||
// --- Puntos predefinidos para colocar elementos en los paneles ---
|
||||
SDL_FPoint slot4_1_, slot4_2_, slot4_3_, slot4_4_;
|
||||
SDL_FPoint enter_name_pos_;
|
||||
|
||||
@@ -42,7 +42,7 @@ struct Color
|
||||
constexpr Color() : r(0), g(0), b(0), a(255) {}
|
||||
explicit constexpr Color(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha = 255) : r(red), g(green), b(blue), a(alpha) {}
|
||||
|
||||
constexpr Color getInverse() const { return Color(255 - r, 255 - g, 255 - b, a); }
|
||||
constexpr Color inverse() const { return Color(255 - r, 255 - g, 255 - b, a); }
|
||||
constexpr Color lighten(int amount = 50) const
|
||||
{
|
||||
return Color(
|
||||
@@ -176,12 +176,6 @@ constexpr Color SHADOW_TEXT_COLOR = Color(0X43, 0X43, 0X4F);
|
||||
|
||||
constexpr Color FLASH_COLOR = Color(0XFF, 0XFF, 0XFF);
|
||||
|
||||
constexpr Color ORANGE_COLOR = Color(0XFF, 0X7A, 0X00);
|
||||
constexpr Color ORANGE_SOFT_COLOR = Color(0XFF, 0XA0, 0X33);
|
||||
constexpr Color ORANGE_SHADOW_COLOR = ORANGE_SOFT_COLOR.darken(100);
|
||||
|
||||
constexpr Color GREEN_COLOR = Color(0X5B, 0XEC, 0X95);
|
||||
|
||||
constexpr Color BLUE_SKY_COLOR = Color(0X02, 0X88, 0XD1);
|
||||
constexpr Color PINK_SKY_COLOR = Color(0XFF, 0X6B, 0X97);
|
||||
constexpr Color GREEN_SKY_COLOR = Color(0X00, 0X79, 0X6B);
|
||||
|
||||
Reference in New Issue
Block a user