如何实现高清“视网膜显示” Cocos2D 中的图形
我不太清楚如何在 cocos2d 中使用高清图像作为精灵。我查看了文档,并下载了支持点而不是像素的最新测试版,但我不理解整个 -hd 后缀的想法。换句话说,我需要帮助,但不知道如何在我的 cocos2d 游戏中使用视网膜质量图形。我觉得这很简单,但我找不到这样做的任何东西。任何帮助将不胜感激。
好吧,也许这要求太多了,但是,如果有人能给我代码并告诉我把它放在哪里,那将会非常有帮助。 (这可能要求太多了)但如果它是一行或太多,如果你能发布它那就太好了。我在这里完全一无所知。我尝试过的一件事是设置内容比例因子。图像是高清的,但 iPod touch 第 4 代上的 fps 下降至 12 fps 左右。我实在不明白这一点。
谢谢,
泰特
I am not quite sure how use HD images for sprites in cocos2d. I looked through the documentation, and downloaded the newest beta which supports points instead of pixels, but I don't understand the whole -hd suffix idea. In other word I need help and have no idea how to use retina quality graphics in my cocos2d game. I feel that it is very simple, but I cannot find anything on doing this. Any help would be greatly appreciated.
Ok so maybe this is asking too much but, it would be very helpful if someone could give me the code a tell me where to put it. (Thats probably too much to ask) But if it is a line or too, it would be great if you could post it. I am absolutely clueless here. One thing I did try, was to set the content scale factor. The image was hi-def, but the fps went way down to around 12fps on an iPod touch 4th gen. I really do not understand this.
Thanks,
Tate
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用的是最新的测试版,您需要做的唯一更改是以两倍大小导出所有图像并使用“-hd”后缀,类似于 Apple 的“@2x”。文档还说您需要设置导演的内容比例因子,但就我而言,我似乎不需要这样做。
虽然听起来您已经阅读过它,但我将链接到 该文档希望有人会受益。
If you're using the latest beta, the only change you should need to make is export all your images at twice the size and use the "-hd" suffix, similar to Apple's "@2x". The documentation also says you need to set the content scale factor of the director, but in my case I didn't seem to need to do that.
Though it sounds like you've already read through it, I'll link to the documentation in hopes that someone will benefit.
我认为“-hd”用于Cocos2D-iPhone,“@2x”用于Apple使用的图标(例如Default.png)。
如果您想看到差异,1)在正常版本和“-hd”版本之间设置略有不同的图像(例如,不同颜色,添加微小的变化),然后2)在模拟器中使用“iPhone”(适用于iPhone 3 GS)运行它然后使用“iPhone(Retina)”(适用于 iPhone 4+),您应该会看到显示不同的内容。
希望这有帮助。
I think the "-hd" is for Cocos2D-iPhone, the "@2x" is for icons used by Apple (e.g. Default.png).
If you want to see the difference, 1) setup slightly diff images (e.g diff colour, add minor changes) between normal and the "-hd" version, then 2) run it in simulator with "iPhone" (for iPhone 3 GS) and then with "iPhone(Retina)" (for iPhone 4+) and you should see different one been displayed.
Hope this helps.