Precarga de los ficheros .txt con los offsets del texto

This commit is contained in:
2022-10-29 11:17:33 +02:00
parent c1f0f90b16
commit 0758cf9de1
14 changed files with 203 additions and 36 deletions

View File

@@ -154,7 +154,7 @@ bool Menu::load(std::string file_path)
// Crea el objeto text tan pronto como se pueda. Necesario para añadir items
if (font_png != "" && font_txt != "" && !textAllocated)
{
text = new Text(font_png, asset->get(font_txt), resource, renderer);
text = new Text(resource->getOffset(font_txt), resource->getTexture(font_png), renderer);
textAllocated = true;
}
}
@@ -977,6 +977,6 @@ void Menu::setText(std::string font_png, std::string font_txt)
{
if (!text)
{
text = new Text(font_png, font_txt, resource, renderer);
text = new Text(resource->getOffset(font_txt), resource->getTexture(font_png), renderer);
}
}