FPS Label Implemented

This commit is contained in:
2023-03-21 07:50:21 -07:00
parent bfa0a907f0
commit c93069b2cf
4 changed files with 44 additions and 27 deletions

View File

@ -44,7 +44,10 @@ void BitmapFont::buffer(
size_t j = 0;
size_t wordStart = 0;
glm::vec2 xy0(0, 0);
glm::vec2 tileSize = glm::vec2(tileset->getTileWidth(), tileset->getTileHeight());
glm::vec2 tileSize =
glm::vec2(tileset->getTileWidth(), tileset->getTileHeight()) *
(fontSize / this->getDefaultFontSize())
;
// Buffer quads
while(c = text[i++]) {
@ -139,9 +142,9 @@ void BitmapFont::draw(Mesh *mesh, int32_t start, int32_t len) {
}
float_t BitmapFont::getLineHeight(float_t fontSize) {
return 16.0f;
return tileset->getTileHeight();
}
float_t BitmapFont::getDefaultFontSize() {
return 16.0f;
return tileset->getTileHeight();
}