COSC-3P98-Final-Project/include/render/ui/text.h

39 lines
876 B
C
Raw Normal View History

2023-02-15 00:49:27 -05:00
/*
* Created by Brett on 14/02/23.
* Licensed under GNU General Public License V3.0
* See LICENSE file for license detail
*/
#ifndef FINALPROJECT_TEXT_H
#define FINALPROJECT_TEXT_H
#include <blt/math/math.h>
2023-02-17 10:55:21 -05:00
#include <string>
2023-03-16 22:37:03 -04:00
namespace fp::graphics {
2023-02-17 10:55:21 -05:00
struct text_size {
int w,h;
2023-02-15 00:49:27 -05:00
};
2023-02-17 10:55:21 -05:00
enum font_size {
FONT_11 = 11,
FONT_12 = 12,
FONT_14 = 14,
FONT_18 = 18,
FONT_22 = 22,
FONT_36 = 36,
FONT_48 = 48,
FONT_72 = 72
2023-02-15 00:49:27 -05:00
};
2023-02-17 10:55:21 -05:00
void drawText(
const std::string& text, float x, float y, font_size size, const blt::vec4& color = {1.0, 1.0, 1.0, 1.0},
const blt::vec4& backgroundColor = {0.0, 0.0, 0.0, 0.0}, float scale = 1
);
text_size getTextSize(const std::string& text, font_size size, float scale = 1.0);
2023-02-15 00:49:27 -05:00
}
#endif //FINALPROJECT_TEXT_H