cocos2d中的水效果

发布于 2024-09-27 07:28:28 字数 542 浏览 2 评论 0原文

我想在我的应用程序的背景层上有水效果。该效果不需要对触摸或任何东西做出反应 - 它只需要稍微晃动图像即可。

CCWaves3D 看起来不错,但当我运行它时,边缘周围留下了令人讨厌的黑色伪影。类似CCShaky3D。 CCLiquid 将我的应用程序的帧率从 20 fps 降低到 5 fps。

我是否还想尝试其他效果?或者也许我以错误的方式使用当前效果?

id shaky = [CCShaky3D actionWithRange:4 shakeZ:NO grid:ccg(15,10) duration:4];
id liquid = [CCLiquid actionWithSize:ccg(15,10) duration:1];
id wave = [CCWaves3D actionWithWaves:18 amplitude:80 grid:ccg(15,10) duration:10];

额外问题 - 我在哪里可以找到关于 cocos2d 效果的任何好的文档?我发现默认的 cocos2d 文档完全没用&在问这个问题之前浪费了几个小时尝试谷歌:/

I'd like to have a water effect on a background layer in my app. The effect doesn't need to react to touch or anything - it just needs to wave an image a little bit.

CCWaves3D seem ok, but leave have nasty black artifacts around the edges when I run it. Similarly CCShaky3D. CCLiquid brings my app down from 20fps to 5fps..

Is there any other effect I might want to try out? Or perhaps I'm using the current effects in a wrong way?

id shaky = [CCShaky3D actionWithRange:4 shakeZ:NO grid:ccg(15,10) duration:4];
id liquid = [CCLiquid actionWithSize:ccg(15,10) duration:1];
id wave = [CCWaves3D actionWithWaves:18 amplitude:80 grid:ccg(15,10) duration:10];

Bonus question - where can I find any good documentation for cocos2d effects? I found default cocos2d docs utterly useless & wasted a couple of hours trying to google before asking this question :/

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

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

发布评论

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

评论(1

小嗲 2024-10-04 07:28:28

我注意到在调试模式下构建/运行时存在性能问题。您是否尝试过在发布模式下构建/运行?另外,您是否在设备上而不只是在模拟器上遇到这种情况?

不幸的是,我没有找到专门针对 cocos2d 效果的替代文档。以下是我收集的许多不同资源的帖子和网站的一些链接,包括教程、制作图块地图游戏的工具、使用 zwoptex 制作精灵表、使用顶点助手制作用于 box2d/chipmunk 碰撞检测的顶点 plist 文件,而不是只是矩形以及图像和图像的站点声音:

Cocos2d 资源

需要设计 2D iPhone 图形

http://www.learn-cocos2d.com/knowledge-base/tutorial-professional-cocos2d-xcode-project-template/

我有发现 Ray 的教程对于查看 cocos2d 附带的测试应用程序特别有帮助。

快乐编码!

I have noticed performance issues when building/running in debug mode. Have you tried to build/run in release mode? Also, are you experiencing this on the device and not just on the simulator?

Unfortunately, I have not found alternate documentation specifically for cocos2d effects. Here are a few links to posts and sites I have gathered for many different resources including tutorials, tools for making tile map games, using zwoptex for making sprite sheets, using vertex helper for making a verticies plist file for box2d/chipmunk collision detection instead of just rectangles, and sites for images & sounds:

Cocos2d Resources

Need 2D iPhone graphics designed

http://www.learn-cocos2d.com/knowledge-base/tutorial-professional-cocos2d-xcode-project-template/

I have found Ray's Tutorials especially helpful along with viewing the test applications included with cocos2d.

Happy coding!

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