Corona 应用程序的组件及其执行顺序是什么?

发布于 2024-12-12 04:20:56 字数 352 浏览 0 评论 0原文

我想知道 Corona 应用程序循环中首先调用两个处理函数中的哪一个:

displayObject:addEventListener( "touch", handler1 ) 
Runtime:addEventListener( "enterFrame", handler2 )

我可以测试它,但不能确保它始终如此,并且 Ansca 人员不会更改它。由于我使用“enterframe”事件来触发我的游戏代码循环,因此最好知道我的游戏代码还是我的 UI 代码首先运行。

然后我意识到我根本没有从 Ansca 找到任何描述执行循环的文档。编码员可能感兴趣的幕后还有哪些事情发生,顺序是什么?有人参考一些文档吗?

I was wondering which of the two handler functions were called first in a Corona app loop:

displayObject:addEventListener( "touch", handler1 ) 
Runtime:addEventListener( "enterFrame", handler2 )

I could test for it, but wouldnt be ensured that it was consistently that way and that the Ansca guys wouldnt change it. Since I use the "enterframe" event to trigger my game code loop, it would be good to know whether my game code or my UI code runs first.

I then realized that I hadnt found any documentation from Ansca that described the execution loop at all. What else is going on behind the scenes that might be of interest to the coder, and in what order? Does anybody have a reference to some documentation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

罪歌 2024-12-19 04:20:56

基本上,带有 Enterframe 事件的运行时会在帧的每次更改时自动运行,或者您可以说它每毫秒运行一次。因此,每毫秒调用一次 Handler2。现在,当您触摸屏幕时,您的 handler1 函数 被调用为handler2 function 的调用时间差很小。因此,很难说哪个函数首先被调用。希望您已经理解了。

Basically Runtime with enterframe Events run automatically on every change in frames or you can say that it runs every milliseconds.So, Handler2 is called every milliseconds.Now,when you touch the screen your handler1 function is called as well as handler2 function is called with very little time difference.So, it is very difficult to say which function is being called first.Hope you have understood it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文