Acabat el nou motor per a textos en pantalla

This commit is contained in:
2024-10-30 09:25:28 +01:00
parent b43782786a
commit 20c51d0796
11 changed files with 269 additions and 274 deletions

View File

@@ -238,26 +238,31 @@ void Resource::createTextures()
: name(name_init), text(text_init) {}
};
std::cout << "\n>> CREATING TEXTURES" << std::endl;
auto text = std::make_unique<Text>(getTexture("04b_25.png"), getTextFile("04b_25.txt"));
// Tamaño normal
std::vector<NameAndText> strings = {
NameAndText("game_text_1000_points", "1.000"),
NameAndText("game_text_2500_points", "2.500"),
NameAndText("game_text_5000_points", "5.000"),
NameAndText("game_text_powerup", "PowerUp"),
NameAndText("game_text_one_hit", "+1 Hit"),
NameAndText("game_text_stop", "Stop!")};
NameAndText("game_text_powerup", lang::getText(117)),
NameAndText("game_text_one_hit", lang::getText(118)),
NameAndText("game_text_stop", lang::getText(119)),
NameAndText("1000000_points", lang::getText(76))};
auto text = std::make_unique<Text>(getTexture("04b_25.png"), getTextFile("04b_25.txt"));
std::cout << "\n>> CREATING TEXTURES" << std::endl;
for (const auto &s : strings)
{
textures_.emplace_back(ResourceTexture(s.name, text->writeToTexture(s.text, 1, -2)));
printWithDots("Texture : ", s.name, "[ DONE ]");
}
// Tamaño doble
std::vector<NameAndText> strings2X = {
NameAndText("get_ready", lang::getText(75)),
NameAndText("stages_remaining", "9 " + lang::getText(38))};
NameAndText("last_stage", lang::getText(79)),
NameAndText("congratulations", lang::getText(50)),
NameAndText("game_over", "Game Over")};
for (const auto &s : strings2X)
{