aboutsummaryrefslogtreecommitdiff
path: root/src/lua/graphics/Font.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/graphics/Font.h')
-rw-r--r--src/lua/graphics/Font.h52
1 files changed, 52 insertions, 0 deletions
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