Credits: retocs en els colors de fondo, el rectangle del borde i en els textos

This commit is contained in:
2025-07-14 23:32:36 +02:00
parent df53c39200
commit c61984bb21
6 changed files with 66 additions and 25 deletions

View File

@@ -40,7 +40,7 @@ title.press_start_position 180 # Posición Y del texto "Press Start"
title.title_duration 800 # Duración de la pantalla de título (frames)
title.arcade_edition_position 123 # Posición Y del subtítulo "Arcade Edition"
title.title_c_c_position 80 # Posición Y del título principal
title.bg_color 988db3 # Color de fondo en la sección titulo
title.bg_color 39393F # Color de fondo en la sección titulo
## --- BACKGROUND ---
background.attenuate_color FFFFFF00 # Color de atenuación del fondo (RGBA hexadecimal)
@@ -76,7 +76,7 @@ service_menu.bg_color 000F00F5 # Color de fondo del menú de servicio (
service_menu.drop_shadow false # ¿El menú de servicio tiene sombra?
## --- INTRO ---
intro.bg_color dbdb82 # Color de fondo de la intro
intro.bg_color 39393F # Color de fondo de la intro
intro.card_color CBDBFC # Color de las tarjetas en la intro
intro.shadow_color 00000080 # Color de la sombra de las tarjetas en la intro
intro.text_distance_from_bottom 48 # Posicion del texto

View File

@@ -49,7 +49,7 @@ Director::Director(int argc, const char *argv[])
Section::name = Section::Name::GAME;
Section::options = Section::Options::GAME_PLAY_1P;
#elif DEBUG
Section::name = Section::Name::INTRO;
Section::name = Section::Name::CREDITS;
Section::options = Section::Options::GAME_PLAY_1P;
#else // NORMAL GAME
Section::name = Section::Name::LOGO;

View File

@@ -169,35 +169,39 @@ void Credits::fillTextTexture()
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 0, 0, 0, 0);
SDL_RenderClear(Screen::get()->getRenderer());
const std::array<std::string, 10> TEXTS = {
const std::array<std::string, 11> TEXTS = {
Lang::getText("[CREDITS] PROGRAMMED_AND_DESIGNED_BY"),
Lang::getText("[CREDITS] PIXELART_DRAWN_BY"),
Lang::getText("[CREDITS] MUSIC_COMPOSED_BY"),
Lang::getText("[CREDITS] SOUND_EFFECTS"),
"JAILDESIGNER",
"JAILDOCTOR (INTRO)",
"JAILDOCTOR",
"ERIC MATYAS (SOUNDIMAGE.ORG)",
"WWW.THEMOTIONMONKEY.CO.UK",
"WWW.KENNEY.NL",
"JAILDOCTOR"};
"JAILDOCTOR",
"JAILDESIGNER"};
const int SPACE_POST_TITLE = 3 + text->getCharacterSize();
const int SPACE_PRE_TITLE = text->getCharacterSize() * 4;
const int TEXTS_HEIGHT = 1 * text->getCharacterSize() + 7 * SPACE_POST_TITLE + 3 * SPACE_PRE_TITLE;
const int TEXTS_HEIGHT = 1 * text->getCharacterSize() + 8 * SPACE_POST_TITLE + 3 * SPACE_PRE_TITLE;
credits_rect_dst_.h = credits_rect_src_.h = TEXTS_HEIGHT;
int y = (param.game.height - TEXTS_HEIGHT) / 2;
// PROGRAMMED_AND_DESIGNED_BY
y = 0;
text_grad->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(0), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
y += SPACE_POST_TITLE;
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(4), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
// PIXELART_DRAWN_BY
y += SPACE_PRE_TITLE;
text_grad->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(1), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
y += SPACE_POST_TITLE;
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(4), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
// MUSIC_COMPOSED_BY
y += SPACE_PRE_TITLE;
text_grad->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(2), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
@@ -206,6 +210,7 @@ void Credits::fillTextTexture()
y += SPACE_POST_TITLE;
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(6), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
// SOUND_EFFECTS
y += SPACE_PRE_TITLE;
text_grad->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(3), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
y += SPACE_POST_TITLE;
@@ -214,6 +219,8 @@ void Credits::fillTextTexture()
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(8), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
y += SPACE_POST_TITLE;
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(9), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
y += SPACE_POST_TITLE;
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(10), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
// Mini logo
y += SPACE_PRE_TITLE;
@@ -267,7 +274,9 @@ void Credits::fillCanvas()
SDL_RenderFillRect(Screen::get()->getRenderer(), &right_black_rect_);
// Dibuja el rectangulo rojo
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 0xFF, 0, 0, 0xFF);
// SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 0xFF, 0, 0, 0xFF);
const Color color = color_.lighten();
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), color.r, color.g, color.b, 0xFF);
SDL_RenderRect(Screen::get()->getRenderer(), &red_rect);
// Si el mini_logo está en su destino, lo dibuja encima de lo anterior
@@ -490,15 +499,18 @@ void Credits::resetVolume()
// Cambia el color del fondo
void Credits::cycleColors()
{
constexpr int UPPER_LIMIT = 255; // Límite superior
constexpr int LOWER_LIMIT = 80; // Límite inferior
// constexpr int UPPER_LIMIT = 255; // Límite superior
// constexpr int LOWER_LIMIT = 80; // Límite inferior
constexpr int UPPER_LIMIT = 140; // Límite superior
constexpr int LOWER_LIMIT = 30; // Límite inferior
static float r = static_cast<float>(UPPER_LIMIT);
static float g = static_cast<float>(LOWER_LIMIT);
static float b = static_cast<float>(LOWER_LIMIT);
static float stepR = -0.5f; // Paso flotante para transiciones suaves
static float stepG = 0.3f;
static float stepB = 0.7f;
static float stepB = 0.1f;
// Ajustar valores de R
r += stepR;
@@ -522,7 +534,8 @@ void Credits::cycleColors()
}
// Aplicar el color, redondeando a enteros antes de usar
tiled_bg_->setColor(Color(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b)));
color_ = Color(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b));
tiled_bg_->setColor(color_);
}
// Actualza los jugadores

View File

@@ -55,6 +55,7 @@ private:
// --- Diseño y posicionamiento ---
float black_bars_size_ = (param.game.game_area.rect.h - PLAY_AREA_HEIGHT) / 2; // Tamaño de las barras negras
int mini_logo_final_pos_ = 0; // Posición final del minilogo
Color color_; // Color usado para los efectos
// --- Control de audio ---
int initial_volume_ = Options::audio.music.volume; // Volumen inicial

View File

@@ -40,6 +40,7 @@ Instructions::Instructions()
view_ = param.game.game_area.rect;
// Inicializa objetos
tiled_bg_->setColor(param.title.bg_color);
fade_->setColor(param.fade.color);
fade_->setType(FadeType::FULLSCREEN);
fade_->setPostDuration(param.fade.post_duration);

View File

@@ -24,6 +24,8 @@
#include "writer.h" // Para Writer
#include "input.h"
#include <iomanip> // Para std::hex, std::setw, std::setfill
// Constructor
Intro::Intro()
: tiled_bg_(std::make_unique<TiledBG>(param.game.game_area.rect, TiledBGMode::DIAGONAL))
@@ -49,36 +51,56 @@ void Intro::checkEvents()
SDL_Event event;
while (SDL_PollEvent(&event))
{
#ifdef DEBUG
if (event.type == SDL_EVENT_KEY_DOWN && event.key.repeat == 1)
{
static Color color = Color(128, 128, 128);
static Color color = param.intro.bg_color;
switch (event.key.key)
{
case SDLK_A:
if (color.r < 255)
++color.r;
if (color.r > 255)
color.r = 0;
break;
case SDLK_Z:
if (color.r > 0)
--color.r;
if (color.r < 0)
color.r =255;
break;
case SDLK_S:
if (color.g < 255)
++color.g;
break;
case SDLK_X:
if (color.g > 0)
--color.g;
break;
case SDLK_D:
if (color.b < 255)
++color.b;
break;
case SDLK_C:
if (color.b > 0)
--color.b;
case SDLK_F:
if (color.r < 255)
++color.r;
if (color.g < 255)
++color.g;
if (color.b < 255)
++color.b;
break;
case SDLK_V:
if (color.r > 0)
--color.r;
if (color.g > 0)
--color.g;
if (color.b > 0)
--color.b;
break;
@@ -86,9 +108,13 @@ void Intro::checkEvents()
break;
}
tiled_bg_->setColor(color);
std::cout << (int)color.r << "," << (int)color.g << "," << (int)color.b << std::endl;
std::cout << "#"
<< std::hex << std::setw(2) << std::setfill('0') << (int)color.r
<< std::setw(2) << std::setfill('0') << (int)color.g
<< std::setw(2) << std::setfill('0') << (int)color.b
<< std::endl;
}
#endif
GlobalEvents::check(event);
}
}