iphone - 我怎样才能延迟或暂停 ansca 电晕中的功能? (路亚)

标签 iphone windows sdk lua coronasdk

我在任何地方都找不到它的文档:/

(问题是标题)

找到 this但无法让它工作。

function onCollision( event )
   --code-- 
end

Runtime:addEventListener( "collision", listener )

 local function listener( event )
     timer.performWithDelay(
1000, onCollision )
end

最佳答案

您的问题是代码顺序之一。 function 本质上是设置给定符号的值。 From the Lua manual :

The statement

 function f () body end

translates to

 f = function () body end

因此,当您将 listener 传递给 addEventListener 时,listenernil。重新排序,它应该可以工作:

function onCollision( event )
   --code-- 
end

local function listener( event )
  timer.performWithDelay(1000, onCollision )
end

Runtime:addEventListener( "collision", listener )

关于iphone - 我怎样才能延迟或暂停 ansca 电晕中的功能? (路亚),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7138548/

相关文章:

ios - iPhone 中的 UIDatePicker 大小调整

windows - 如何创建 PowerShell 脚本以将文件复制到 USB 闪存驱动器?

安卓sdk安装。错误 : Invalid content was found starting with element 'd:skin' . 此时不应有子元素

Android Studio 不允许我导入 SDK

.net - 使用 Azure SDK for .NET 获取 Azure 资源 SKU

iphone - 自定义 uitableviewcell 中的导航

iphone - 移动 map 叠加层

ios - 使用 [Class retain] : message sent to deallocated instance 使 iOS 应用程序崩溃

windows - 复制文件夹内容

windows - 性能随机下降