transition.to( ) doesn't work within a function and with a Runtime:addEventListener( “enterFrame”, method) listener in Corona / Lua

夙愿已清 提交于 2019-12-07 09:07:26

The enterFrame listener is called by the Corona runtime every time the screen is refreshed--probably 30 frames per second. So every 33 ms, you start an animation on the square, which takes 1500 ms to complete. Just as it gets started, you add yet another animation. And so on. You should use this event to handle animations that you have to manage directly because the movement or changes are beyond the capabilities of the transition functions. The whole point of using the transition functions is to avoid the need for this kind of direct control for most animations.

The touch listener is called only when the user touches the screen, so you don't get repeated invocations of the move event. The performWithDelay method also calls the move event just once. You probably want to use one of these approaches.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!