From 5c9af043503f92852a1a765b6ecfbc1aea24d2e9 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 14 Aug 2018 14:56:47 +0800 Subject: *update --- src/lua/graphics/Font.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/lua/graphics/Font.h (limited to 'src/lua/graphics/Font.h') diff --git a/src/lua/graphics/Font.h b/src/lua/graphics/Font.h new file mode 100644 index 0000000..b3b66a8 --- /dev/null +++ b/src/lua/graphics/Font.h @@ -0,0 +1,52 @@ +#ifndef __JIN_LUA_GRAPHICS_FONT_H +#define __JIN_LUA_GRAPHICS_FONT_H +#include "libjin/jin.h" +#include "../luaopen_types.h" + +namespace jin +{ +namespace lua +{ +namespace graphics +{ + + class Font : public Object + { + public: + Font() + { + font = new jin::graphics::Font(); + } + + void box(const char* str, int fheight, int spacing, int lheight, int* w, int * h) + { + font->box(str, fheight, spacing, lheight, w, h); + } + void loadb(const unsigned char* data) + { + font->loadb(data); + } + void render( + const char* text, // rendered text + float x, float y, // render position + int fheight, // font height + int spacing, // font spacing + int lheight) // line height + { + font->render(text, x, y, fheight, spacing, lheight); + } + private: + ~Font() + { + delete font; + } + + jin::graphics::Font* font; + + }; + +} // graphics +} // lua +} // jin + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0