Added 3 unicode pages for font, fixed UI, added Block.breakable

Added 1, 2, 3 and 4 unicode pages from Minecraft.
Font now uses std::wstring instead of std::string
Added Block.breakable field (the only unbreakable block is bedrock)
Bedrock is now selectable
This commit is contained in:
MihailRis
2022-07-14 19:23:31 +03:00
committed by GitHub
parent b2872650d6
commit bdd3fbf7d4
17 changed files with 94 additions and 47 deletions
+6 -5
View File
@@ -2,20 +2,21 @@
#define GRAPHICS_FONT_H_
#include <string>
#include <vector>
class Texture;
class Batch2D;
class Font {
public:
Texture* texture;
Font(Texture* texture);
std::vector<Texture*> pages;
Font(std::vector<Texture*> pages);
~Font();
int getGlyphWidth(char c);
bool isPrintableChar(char c);
void draw(Batch2D* batch, std::string text, int x, int y);
void drawWithShadow(Batch2D* batch, std::string text, int x, int y);
bool isPrintableChar(int c);
void draw(Batch2D* batch, std::wstring text, int x, int y);
void drawWithShadow(Batch2D* batch, std::wstring text, int x, int y);
};
#endif /* GRAPHICS_FONT_H_ */