Added Text:setFont.

This commit is contained in:
Alex Szpakowski
2015-04-27 04:19:03 -03:00
parent f29567160a
commit 90a3c2b8ba
4 changed files with 21 additions and 0 deletions
+10
View File
@@ -265,6 +265,16 @@ void Text::draw(float x, float y, float angle, float sx, float sy, float ox, flo
glDisableVertexAttribArray(ATTRIB_POS);
}
void Text::setFont(Font *f)
{
font.set(f);
// Invalidate the texture cache ID since the font is different. We also have
// to re-upload all the vertices based on the new font's textures.
texture_cache_id = (uint32) -1;
regenerateVertices();
}
Font *Text::getFont() const
{
return font.get();