public static void Push(IntPtr L, Touch t, int flag) { LuaStatic.GetPackTouch(L); LuaDLL.lua_pushinteger(L, t.fingerId); if ((flag & TouchBits.Position) != 0) { Push(L, t.position); } else { LuaDLL.lua_pushnil(L); } if ((flag & TouchBits.RawPosition) != 0) { Push(L, t.rawPosition); } else { LuaDLL.lua_pushnil(L); } if ((flag & TouchBits.DeltaPosition) != 0) { Push(L, t.deltaPosition); } else { LuaDLL.lua_pushnil(L); } LuaDLL.lua_pushnumber(L, t.deltaTime); LuaDLL.lua_pushinteger(L, t.tapCount); LuaDLL.lua_pushinteger(L, (int)t.phase); if (LuaDLL.lua_pcall(L, 7, -1, 0) != 0) { string error = LuaDLL.lua_tostring(L, -1); throw new LuaException(error); } }
public static void Push(IntPtr L, Touch t, int flag) { LuaStatic.GetPackTouch(L); LuaDLL.lua_pushinteger(L, t.get_fingerId()); if ((flag & 2) != 0) { ToLua.Push(L, t.get_position()); } else { LuaDLL.lua_pushnil(L); } if ((flag & 4) != 0) { ToLua.Push(L, t.get_rawPosition()); } else { LuaDLL.lua_pushnil(L); } if ((flag & 1) != 0) { ToLua.Push(L, t.get_deltaPosition()); } else { LuaDLL.lua_pushnil(L); } LuaDLL.lua_pushnumber(L, (double)t.get_deltaTime()); LuaDLL.lua_pushinteger(L, t.get_tapCount()); LuaDLL.lua_pushinteger(L, t.get_phase()); if (LuaDLL.lua_pcall(L, 7, -1, 0) != 0) { string msg = LuaDLL.lua_tostring(L, -1); throw new LuaException(msg, null, 1); } }