Carona SDK 中是否有与 CCMoveTo 等效的工具?
在Cocos2d中,您可以使用“CCMoveTo”方法将精灵移动到特定位置,如下所示:
[sprite runAction: [CCMoveTo actionWithDuration:1 position:location]]; //Moves a sprite to the position "location" in 1 second.
Corona SDK中有类似的东西吗?我尝试过一些谷歌搜索,但没有任何结果。
In Cocos2d you can move a sprite to a specific position using the "CCMoveTo" method like so:
[sprite runAction: [CCMoveTo actionWithDuration:1 position:location]]; //Moves a sprite to the position "location" in 1 second.
Is there something like this in the Corona SDK? I've tried some Googling but nothing is coming up.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想您可能想看看以下 API 示例:
spriteInstance:play()
您可以在其中设置该特定精灵的不同属性并播放新动画。但它没有说明持续时间。
I think you might want to look at the following API Example:
spriteInstance:play()
Where you can set different properties of that particular sprite and play to the new animation. It doesn't say anything about the duration though.
找到了和CCMoveTo类似的方法:
transition.to
Found out a similar method to CCMoveTo:
transition.to