Nova font de text per al text gran amb el doble de definició

This commit is contained in:
2024-11-04 20:28:19 +01:00
parent 2256ee46eb
commit 7b1c2a6005
5 changed files with 203 additions and 5 deletions

View File

@@ -495,6 +495,8 @@ void Director::setFileList()
Asset::get()->add(prefix + "/data/font/smb2.txt", AssetType::FONT);
Asset::get()->add(prefix + "/data/font/04b_25.png", AssetType::BITMAP);
Asset::get()->add(prefix + "/data/font/04b_25.txt", AssetType::FONT);
Asset::get()->add(prefix + "/data/font/04b_25_2x.png", AssetType::BITMAP);
Asset::get()->add(prefix + "/data/font/04b_25_2x.txt", AssetType::FONT);
// Textos
Asset::get()->add(prefix + "/data/lang/es_ES.txt", AssetType::LANG);
@@ -614,7 +616,7 @@ void Director::runGame()
{
const auto player_id = section::options == section::Options::GAME_PLAY_1P ? 1 : 2;
#ifdef DEBUG
constexpr auto current_stage = 9;
constexpr auto current_stage = 0;
#else
constexpr auto current_stage = 0;
#endif

View File

@@ -351,9 +351,9 @@ void Game::updateStage()
createMessage(paths, Resource::get()->getTexture("last_stage"));
else
{
auto text = Resource::get()->getText("04b_25");
auto text = Resource::get()->getText("04b_25_2x");
const std::string caption = std::to_string(10 - current_stage_) + lang::getText(38);
createMessage(paths, text->writeToTexture(caption, 2, -2));
createMessage(paths, text->writeToTexture(caption, 1, -4));
}
}
}

View File

@@ -255,7 +255,6 @@ void Resource::createTextures()
};
std::cout << "\n>> CREATING TEXTURES" << std::endl;
auto text = getText("04b_25");
// Tamaño normal
std::vector<NameAndText> strings = {
@@ -267,6 +266,7 @@ void Resource::createTextures()
NameAndText("game_text_stop", lang::getText(119)),
NameAndText("1000000_points", lang::getText(76))};
auto text = getText("04b_25");
for (const auto &s : strings)
{
textures_.emplace_back(ResourceTexture(s.name, text->writeToTexture(s.text, 1, -2)));
@@ -280,9 +280,10 @@ void Resource::createTextures()
NameAndText("congratulations", lang::getText(50)),
NameAndText("game_over", "Game Over")};
auto text2 = getText("04b_25_2x");
for (const auto &s : strings2X)
{
textures_.emplace_back(ResourceTexture(s.name, text->writeToTexture(s.text, 2, -2)));
textures_.emplace_back(ResourceTexture(s.name, text2->writeToTexture(s.text, 1, -4)));
printWithDots("Texture : ", s.name, "[ DONE ]");
}
}
@@ -294,6 +295,7 @@ void Resource::createText()
std::vector<std::pair<std::string, std::string>> resources = {
{"04b_25", "04b_25.png"},
{"04b_25_2x", "04b_25_2x.png"},
{"8bithud", "8bithud.png"},
{"nokia", "nokia.png"},
{"smb2", "smb2.gif"}};