Cocos2d runAction:在 UIView 上
是否可以在 UIView 上运行像 [CCScaleTo actionWithDuration:.3 scale:1.1]
这样的 cocos2d 操作?我知道可以将 UIView 包装到 CCNode 中,这样您就可以将其作为子级添加到图层中,但我不知道如何。有人能在这里解释一下吗?谢谢!
编辑:我看过 CCUIViewWrapper ,但遇到了一些问题,即 a) 在包装的 UIView 上运行操作会导致它消失,b) 按钮失去其“可推送”功能;它们的选择器不会被触发,并且它们的突出显示状态不会显示。但除此之外它很棒:D
Is it possible to run a cocos2d action like [CCScaleTo actionWithDuration:.3 scale:1.1]
on a UIView? I know it's possible to wrap a UIView into a CCNode so you can add it as a child to a layer, but I have no idea as to how. Could anyone shed some light here? Thanks!
Edit: I've looked at CCUIViewWrapper
but have had a few issues with it, namely that a) running actions on a wrapped UIView causes it to disappear and b) buttons lose their 'pushable' functionality; they're selectors aren't fired and their highlighted state isn't shown. But other than that it's great :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看看 CCUIViewWrapper
http://www.cocos2d-iphone.org/forum/topic/ 22898
Have a look at CCUIViewWrapper
http://www.cocos2d-iphone.org/forum/topic/22898
在为 UIView 制作动画时,我最终不得不使用与 Cocos 动画等效的 Core Graphics,而且它对我来说效果很好。
I eventually had to just use the Core Graphics equivalents to the Cocos animations when animating the UIView, and it worked well enough for me.