Ya escribe los creditos con colores

This commit is contained in:
2022-10-24 13:17:21 +02:00
parent 591932a928
commit db719245a3
3 changed files with 32 additions and 34 deletions

View File

@@ -23,30 +23,30 @@ Credits::Credits(SDL_Renderer *renderer, Screen *screen, Asset *asset)
screen->setBorderColor(stringToColor("black"));
// Inicializa los textos
texts.push_back("");
texts.push_back("INSTRUCTIONS:");
texts.push_back("");
texts.push_back("HELP JAILDOC TO GET BACK ALL HIS");
texts.push_back("PROJECTS AND GO TO THE JAIL TO");
texts.push_back("FINISH THEM");
texts.push_back("");
texts.push_back("");
texts.push_back("KEYS:");
texts.push_back("");
texts.push_back("USE CURSORS TO MOVE AND JUMP");
texts.push_back("F1-F4 TO CHANGE WINDOWS SIZE");
texts.push_back("F TO SWITCH TO FULLSCREEN");
texts.push_back("B TO DE/ACTIVATE THE BORDER SC.");
texts.push_back("M TO TURN ON/OFF THE MUSIC");
texts.push_back("ESC TO EXIT GAME");
texts.push_back("");
texts.push_back("");
texts.push_back("A GAME BY JAILDESIGNER");
texts.push_back("MADE ON SUMMER/FALL 2022");
texts.push_back("");
texts.push_back("");
texts.push_back("LOVE JAILGAMES!}");
texts.push_back("");
texts.push_back({"", stringToColor("white")});
texts.push_back({"INSTRUCTIONS:", stringToColor("yellow")});
texts.push_back({"", stringToColor("white")});
texts.push_back({"HELP JAILDOC TO GET BACK ALL HIS", stringToColor("white")});
texts.push_back({"PROJECTS AND GO TO THE JAIL TO", stringToColor("white")});
texts.push_back({"FINISH THEM", stringToColor("white")});
texts.push_back({"", stringToColor("white")});
texts.push_back({"", stringToColor("white")});
texts.push_back({"KEYS:", stringToColor("yellow")});
texts.push_back({"", stringToColor("white")});
texts.push_back({"USE CURSORS TO MOVE AND JUMP", stringToColor("white")});
texts.push_back({"F1-F4 TO CHANGE WINDOWS SIZE", stringToColor("white")});
texts.push_back({"F TO SWITCH TO FULLSCREEN", stringToColor("white")});
texts.push_back({"B TO DE/ACTIVATE THE BORDER SC.", stringToColor("white")});
texts.push_back({"M TO TURN ON/OFF THE MUSIC", stringToColor("white")});
texts.push_back({"ESC TO EXIT GAME", stringToColor("white")});
texts.push_back({"", stringToColor("white")});
texts.push_back({"", stringToColor("white")});
texts.push_back({"A GAME BY JAILDESIGNER", stringToColor("yellow")});
texts.push_back({"MADE ON SUMMER/FALL 2022", stringToColor("yellow")});
texts.push_back({"", stringToColor("white")});
texts.push_back({"", stringToColor("white")});
texts.push_back({"LOVE JAILGAMES!}", stringToColor("white")});
texts.push_back({"", stringToColor("white")});
// Crea la textura para el texto que se escribe en pantalla
textTexture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT);
@@ -125,7 +125,7 @@ void Credits::fillTexture()
for (auto t : texts)
{
text->write(0, i * size, t);
text->writeColored(0, i * size, t.label, t.color);
i++;
}