aboutsummaryrefslogtreecommitdiff
path: root/src/lua/modules/graphics/graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/modules/graphics/graphics.cpp')
-rw-r--r--src/lua/modules/graphics/graphics.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/lua/modules/graphics/graphics.cpp b/src/lua/modules/graphics/graphics.cpp
index 620c239..645ae4a 100644
--- a/src/lua/modules/graphics/graphics.cpp
+++ b/src/lua/modules/graphics/graphics.cpp
@@ -277,6 +277,24 @@ namespace lua
font->print(page, x, y);
}
+ /* print(string, x, y, lineheight, spacing) */
+ /* need set font */
+ static int l_print(lua_State* L)
+ {
+ Font* font = context.curFont;
+ if (font == nullptr)
+ return 0;
+ unsigned length;
+ const char* str = luax_checklstring(L, 1, &length);
+ Text text(Encode::UTF8, str, length);
+ int x = luax_optnumber(L, 2, 0);
+ int y = luax_optnumber(L, 3, 0);
+ int lineheight = luax_optnumber(L, 4, font->getFontSize());
+ int spacing = luax_optnumber(L, 5, 0);
+ font->print(text, x, y, lineheight, spacing);
+ return 0;
+ }
+
static int l_draw(lua_State* L)
{
if (luax_istype(L, 1, JIN_GRAPHICS_TEXTURE))
@@ -337,24 +355,6 @@ namespace lua
}
}
- /* print(string, x, y, lineheight, spacing) */
- /* need set font */
- static int l_print(lua_State* L)
- {
- Font* font = context.curFont;
- if (font == nullptr)
- return 0;
- unsigned length;
- const char* str = luax_checklstring(L, 1, &length);
- Text text(Encode::UTF8, str, length);
- int x = luax_optnumber(L, 2, 0);
- int y = luax_optnumber(L, 3, 0);
- int lineheight = luax_optnumber(L, 4, font->getFontSize());
- int spacing = luax_optnumber(L, 5, 0);
- font->print(text, x, y, lineheight, spacing);
- return 0;
- }
-
static int l_setColor(lua_State* L)
{
if (luax_gettop(L) == 0)