From 7a20483f06624e82feb129c9e4c8fa13881a6a9f Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 22 Nov 2018 12:23:12 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9lua=20bind?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/modules/graphics/je_lua_animator.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/lua/modules/graphics/je_lua_animator.cpp') diff --git a/src/lua/modules/graphics/je_lua_animator.cpp b/src/lua/modules/graphics/je_lua_animator.cpp index 519bc75..857d375 100644 --- a/src/lua/modules/graphics/je_lua_animator.cpp +++ b/src/lua/modules/graphics/je_lua_animator.cpp @@ -132,6 +132,14 @@ namespace JinEngine return 0; } + LUA_IMPLEMENT int l_getSpeed(lua_State* L) + { + SharedAnimator shrAnimator = checkAnimator(L); + float speed = shrAnimator->getSpeed(); + luax_pushnumber(L, speed); + return 1; + } + LUA_EXPORT void luaopen_Animator(lua_State* L) { luaL_Reg methods[] = { @@ -148,6 +156,7 @@ namespace JinEngine { "setDefaultSpeed", l_setDefaultSpeed }, { "setLoop", l_setLoop }, { "setDefaultLoop", l_setDefaultLoop }, + { "getSpeed", l_getSpeed }, { 0, 0 } }; luax_newtype(L, Jin_Lua_Animator, methods); -- cgit v1.1-26-g67d0