aboutsummaryrefslogtreecommitdiff
path: root/src/libjin-lua/modules/graphics/je_lua_text.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-12-20 18:34:50 +0800
committerchai <chaifix@163.com>2018-12-20 18:34:50 +0800
commitee8ef0433e36bf354a717bd4af679a0a5af2e6be (patch)
tree2fc748510200f8bc24928d1938300eecc0604deb /src/libjin-lua/modules/graphics/je_lua_text.cpp
parent7ae40127f15f8f2cb963a7efeb018f7887ebc1ea (diff)
*修改文件结构
Diffstat (limited to 'src/libjin-lua/modules/graphics/je_lua_text.cpp')
-rw-r--r--src/libjin-lua/modules/graphics/je_lua_text.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/libjin-lua/modules/graphics/je_lua_text.cpp b/src/libjin-lua/modules/graphics/je_lua_text.cpp
new file mode 100644
index 0000000..0afbceb
--- /dev/null
+++ b/src/libjin-lua/modules/graphics/je_lua_text.cpp
@@ -0,0 +1,31 @@
+#include "common/je_lua_object.h"
+#include "common/je_lua_common.h"
+#include "libjin/jin.h"
+
+using namespace JinEngine::Graphics;
+
+namespace JinEngine
+{
+ namespace Lua
+ {
+
+ const char* Jin_Lua_Text = "Text";
+
+ LUA_IMPLEMENT int l_gc(lua_State* L)
+ {
+ LuaObject* p = (LuaObject*)luax_checktype(L, 1, Jin_Lua_Text);
+ p->release();
+ return 0;
+ }
+
+ LUA_EXPORT void luaopen_Text(lua_State* L)
+ {
+ luaL_Reg methods[] = {
+ { "__gc", l_gc },
+ { 0, 0 }
+ };
+ luax_newtype(L, Jin_Lua_Text, methods);
+ }
+
+ } // namespace Lua
+} // namespace JinEngine \ No newline at end of file