llevat soport per a colors amb nom
This commit is contained in:
@@ -32,7 +32,7 @@ Credits::Credits()
|
||||
SceneManager::options = SceneManager::Options::NONE;
|
||||
shining_sprite_->setPos({.x = 194, .y = 174, .w = 8, .h = 8});
|
||||
|
||||
Screen::get()->setBorderColor(static_cast<Uint8>(PaletteColor::BLACK)); // Cambia el color del borde
|
||||
Screen::get()->setBorderColor(0); // Cambia el color del borde
|
||||
fillTexture(); // Escribe el texto en la textura
|
||||
Audio::get()->playMusic("574071_EA_DTV.ogg"); // Inicia la musica
|
||||
}
|
||||
@@ -56,33 +56,33 @@ void Credits::iniTexts() { // NOLINT(readability-convert-member-functions-to-st
|
||||
auto* loc = Locale::get();
|
||||
|
||||
texts_.clear();
|
||||
texts_.push_back({.label = "", .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = loc->get("credits.instructions"), .color = static_cast<Uint8>(PaletteColor::YELLOW)});
|
||||
texts_.push_back({.label = "", .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = loc->get("credits.l0"), .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = loc->get("credits.l1"), .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = loc->get("credits.l2"), .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = "", .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = "", .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = "", .color = 14});
|
||||
texts_.push_back({.label = loc->get("credits.instructions"), .color = 12});
|
||||
texts_.push_back({.label = "", .color = 14});
|
||||
texts_.push_back({.label = loc->get("credits.l0"), .color = 14});
|
||||
texts_.push_back({.label = loc->get("credits.l1"), .color = 14});
|
||||
texts_.push_back({.label = loc->get("credits.l2"), .color = 14});
|
||||
texts_.push_back({.label = "", .color = 14});
|
||||
texts_.push_back({.label = "", .color = 14});
|
||||
|
||||
texts_.push_back({.label = loc->get("credits.keys"), .color = static_cast<Uint8>(PaletteColor::YELLOW)});
|
||||
texts_.push_back({.label = "", .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = loc->get("credits.keys_move"), .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = loc->get("credits.f8"), .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = loc->get("credits.f11"), .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = loc->get("credits.f1f2"), .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = loc->get("credits.f3"), .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = loc->get("credits.f9"), .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = "", .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = "", .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = loc->get("credits.keys"), .color = 12});
|
||||
texts_.push_back({.label = "", .color = 14});
|
||||
texts_.push_back({.label = loc->get("credits.keys_move"), .color = 14});
|
||||
texts_.push_back({.label = loc->get("credits.f8"), .color = 14});
|
||||
texts_.push_back({.label = loc->get("credits.f11"), .color = 14});
|
||||
texts_.push_back({.label = loc->get("credits.f1f2"), .color = 14});
|
||||
texts_.push_back({.label = loc->get("credits.f3"), .color = 14});
|
||||
texts_.push_back({.label = loc->get("credits.f9"), .color = 14});
|
||||
texts_.push_back({.label = "", .color = 14});
|
||||
texts_.push_back({.label = "", .color = 14});
|
||||
|
||||
texts_.push_back({.label = loc->get("credits.author"), .color = static_cast<Uint8>(PaletteColor::YELLOW)});
|
||||
texts_.push_back({.label = loc->get("credits.date"), .color = static_cast<Uint8>(PaletteColor::YELLOW)});
|
||||
texts_.push_back({.label = "", .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = "", .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = loc->get("credits.author"), .color = 12});
|
||||
texts_.push_back({.label = loc->get("credits.date"), .color = 12});
|
||||
texts_.push_back({.label = "", .color = 14});
|
||||
texts_.push_back({.label = "", .color = 14});
|
||||
|
||||
texts_.push_back({.label = loc->get("credits.love"), .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = "", .color = static_cast<Uint8>(PaletteColor::WHITE)});
|
||||
texts_.push_back({.label = loc->get("credits.love"), .color = 14});
|
||||
texts_.push_back({.label = "", .color = 14});
|
||||
}
|
||||
|
||||
// Escribe el texto en la textura
|
||||
@@ -93,7 +93,7 @@ void Credits::fillTexture() {
|
||||
// Rellena la textura de texto
|
||||
auto previuos_renderer = Screen::get()->getRendererSurface();
|
||||
Screen::get()->setRendererSurface(text_surface_);
|
||||
text_surface_->clear(static_cast<Uint8>(PaletteColor::BLACK));
|
||||
text_surface_->clear(0);
|
||||
|
||||
auto text = Resource::Cache::get()->getText("smb2");
|
||||
|
||||
@@ -109,7 +109,7 @@ void Credits::fillTexture() {
|
||||
// Escribe el corazón
|
||||
const int TEXT_LENGHT = text->length(texts_[22].label, 1) - text->length(" ", 1); // Se resta el ultimo caracter que es un espacio
|
||||
const int POS_X = ((PlayArea::WIDTH - TEXT_LENGHT) / 2) + TEXT_LENGHT;
|
||||
text->writeColored(POS_X, 176, "ä", static_cast<Uint8>(PaletteColor::BRIGHT_RED));
|
||||
text->writeColored(POS_X, 176, "ä", 5);
|
||||
Screen::get()->setRendererSurface(previuos_renderer);
|
||||
|
||||
// Recoloca el sprite del brillo
|
||||
@@ -219,7 +219,7 @@ void Credits::render() {
|
||||
Screen::get()->start();
|
||||
|
||||
// Limpia la pantalla
|
||||
Screen::get()->clearSurface(static_cast<Uint8>(PaletteColor::BLACK));
|
||||
Screen::get()->clearSurface(0);
|
||||
|
||||
if (state_ != State::EXITING) {
|
||||
// Dibuja la textura con el texto en pantalla
|
||||
@@ -230,7 +230,7 @@ void Credits::render() {
|
||||
|
||||
// Dibuja el sprite con el brillo
|
||||
if (reveal_time_ > SHINE_START_TIME) {
|
||||
shining_sprite_->render(1, static_cast<Uint8>(PaletteColor::BRIGHT_WHITE));
|
||||
shining_sprite_->render(1, 15);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user