mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 05:21:49 +00:00
multiline labels
This commit is contained in:
parent
fcc5d11814
commit
d189bdc107
7 changed files with 239 additions and 95 deletions
|
|
@ -9,25 +9,27 @@
|
|||
class Texture;
|
||||
class Batch2D;
|
||||
|
||||
const uint STYLE_NONE = 0;
|
||||
const uint STYLE_SHADOW = 1;
|
||||
const uint STYLE_OUTLINE = 2;
|
||||
enum class FontStyle {
|
||||
none,
|
||||
shadow,
|
||||
outline
|
||||
};
|
||||
|
||||
class Font {
|
||||
int lineHeight;
|
||||
int lineHeight;
|
||||
int yoffset;
|
||||
public:
|
||||
std::vector<std::unique_ptr<Texture>> pages;
|
||||
Font(std::vector<std::unique_ptr<Texture>> pages, int lineHeight, int yoffset);
|
||||
~Font();
|
||||
std::vector<std::unique_ptr<Texture>> pages;
|
||||
Font(std::vector<std::unique_ptr<Texture>> pages, int lineHeight, int yoffset);
|
||||
~Font();
|
||||
|
||||
int getLineHeight() const;
|
||||
int getLineHeight() const;
|
||||
int getYOffset() const;
|
||||
int calcWidth(std::wstring text, size_t length=-1);
|
||||
// int getGlyphWidth(char c);
|
||||
bool isPrintableChar(int c);
|
||||
void draw(Batch2D* batch, std::wstring text, int x, int y);
|
||||
void draw(Batch2D* batch, std::wstring text, int x, int y, int style);
|
||||
int calcWidth(std::wstring text, size_t length=-1);
|
||||
bool isPrintableChar(uint codepoint) const;
|
||||
void draw(Batch2D* batch, std::wstring text, int x, int y);
|
||||
void draw(Batch2D* batch, std::wstring text, int x, int y, FontStyle style);
|
||||
void draw(Batch2D* batch, std::wstring_view text, int x, int y, FontStyle style);
|
||||
};
|
||||
|
||||
#endif /* GRAPHICS_FONT_H_ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue