按按钮时禁用touchEnd

时间:2014-10-13 01:18:53

标签: touch livecode swipe-gesture

我有一个通过滑动手势控制的游戏。 每转一圈,用户都会滑动并在屏幕上移动棋子。

我的问题是,当按下“开始”按钮时,游戏会启动,有时会同时记录第一个滑动手势。

按下按钮时如何禁用触控信息?

1 个答案:

答案 0 :(得分:1)

您可以在“开始”按钮中添加touchEnd处理程序:

on touchEnd
end touchEnd

只要您在此处理程序中没有pass touchEnd命令,touchEnd处理程序更高的消息层次结构就不会运行。

另一种可能性是检查消息层次结构中的the target

on touchEnd
  if the short name of the target is "Start" then
    exit touchEnd
  else
    // remainder of your script
  end if
end touchEnd