我想在我的应用程序的背景层上添加水效果.效果不需要对触摸或任何东西做出反应 - 它只需要稍微挥动图像即可.
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 看起来不错,但是当我运行它时,边缘会留下令人讨厌的黑色伪影.同样CCShaky3D.CCLiquid 将我的应用程序从 20fps 降低到 5fps..
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];
额外问题 - 我在哪里可以找到 cocos2d 效果的任何好的文档?我发现默认的 cocos2d 文档完全没用 &在问这个问题之前浪费了几个小时试图谷歌:/
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 :/
我注意到在调试模式下构建/运行时出现性能问题.您是否尝试过在发布模式下构建/运行?另外,您是否在设备上体验过这种情况,而不仅仅是在模拟器上?
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?
不幸的是,我还没有找到专门针对 cocos2d 效果的替代文档.以下是我为许多不同资源收集的帖子和网站的一些链接,包括教程、制作瓷砖地图游戏的工具、使用 zwoptex 制作精灵表、使用顶点助手制作用于 box2d/chipmunk 碰撞检测的顶点 plist 文件而不是只是矩形,以及图像和站点声音:
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 资源
需要设计 2D iPhone 图形
http://www.learn-cocos2d.com/knowledge-base/tutorial-professional-cocos2d-xcode-project-template/
我发现 Ray 的教程对于查看 cocos2d 中包含的测试应用程序特别有用.
I have found Ray's Tutorials especially helpful along with viewing the test applications included with cocos2d.
编码愉快!
这篇关于cocos2d中的水效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!