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

BIN
data/font/04b_25_2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

194
data/font/04b_25_2x.txt Normal file
View File

@@ -0,0 +1,194 @@
# box width
28
# box height
28
# 32 espacio ( )
16
# 33 !
10
# 34 "
16
# 35
20
# 36 $
20
# 37 %
18
# 38 &
22
# 39 '
10
# 40 (
14
# 41 )
14
# 42 *
14
# 43 +
18
# 44 ,
10
# 45 -
18
# 46 .
10
# 47 /
24
# 48 0
16
# 49 1
12
# 50 2
16
# 51 3
16
# 52 4
16
# 53 5
16
# 54 6
16
# 55 7
16
# 56 8
16
# 57 9
16
# 58 :
10
# 59 ;
10
# 60 <
16
# 61 =
16
# 62 >
16
# 63 ?
16
# 64 @
22
# 65 A
16
# 66 B
16
# 67 C
16
# 68 D
16
# 69 E
16
# 70 F
16
# 71 G
16
# 72 H
16
# 73 I
10
# 74 J
16
# 75 K
16
# 76 L
16
# 77 M
22
# 78 N
16
# 79 O
16
# 80 P
16
# 81 Q
16
# 82 R
16
# 83 S
16
# 84 T
18
# 85 U
16
# 86 V
16
# 87 W
22
# 88 X
16
# 89 Y
16
# 90 Z
16
# 91 [
14
# 92 \
22
# 93 ]
14
# 94 ^
12
# 95 _
14
# 96 `
12
# 97 a
16
# 98 b
16
# 99 c
16
# 100 d
16
# 101 e
16
# 102 f
16
# 103 g
16
# 104 h
16
# 105 i
10
# 106 j
16
# 107 k
16
# 108 l
16
# 109 m
22
# 110 n
16
# 111 o
16
# 112 p
16
# 113 q
16
# 114 r
16
# 115 s
16
# 116 t
18
# 117 u
16
# 118 v
16
# 119 w
22
# 120 x
16
# 121 y
16
# 122 z
16
# 123 {
2
# 124 |
2
# 125 }
2
# 126 ~
2

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/smb2.txt", AssetType::FONT);
Asset::get()->add(prefix + "/data/font/04b_25.png", AssetType::BITMAP); 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.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 // Textos
Asset::get()->add(prefix + "/data/lang/es_ES.txt", AssetType::LANG); 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; const auto player_id = section::options == section::Options::GAME_PLAY_1P ? 1 : 2;
#ifdef DEBUG #ifdef DEBUG
constexpr auto current_stage = 9; constexpr auto current_stage = 0;
#else #else
constexpr auto current_stage = 0; constexpr auto current_stage = 0;
#endif #endif

View File

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