Cocos2d runAction:在 UIView 上

发布于 2024-12-27 16:48:19 字数 300 浏览 2 评论 0原文

是否可以在 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 技术交流群。

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

发布评论

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

评论(2

九八野马 2025-01-03 16:48:19

在为 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.

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