Closed fxliang closed 4 months ago
可以綁在一起嗎
int raw_make(lua_State *L) { an<T> res; // nil int n = lua_gettop(L); if ( n == 1 ) res = New<T>(string(lua_tostring(L, 1)); else if (n > 1) res = New<T>( lua_tointeger(L, 1), lua_tointeger(L, 2)); LuaType<an<T>>::pushdata(L, res); return 1; }
KeyEvent( string) KeyEvent( int code, int modifier)
试了不行
我試可以的 , KeyEvent 要重定義
int raw_make(lua_State *L) {
an<T> res;
int n = lua_gettop(L);
if (n == 1)
res = New<T>( string(lua_tostring(L, 1)) );
else if (n > 1)
res = New<T>(lua_tointeger(L, 1), lua_tointeger(L, 2));
LuaType<an<T>>::pushdata(L, res);
return 1;
}
static const luaL_Reg funcs[] = {
{ "KeyEvent", raw_make},
{ NULL, NULL },
};
原来是我打开方式不对(加了WRAP...)
可以綁在一起嗎
KeyEvent( string) KeyEvent( int code, int modifier)