如何实现高清“Retina Display"Cocos2D 中的图形

How to implement HD quot;Retina Displayquot; graphics in Cocos2D(如何实现高清“Retina DisplayCocos2D 中的图形)

本文介绍了如何实现高清“Retina Display"Cocos2D 中的图形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太确定如何在 cocos2d 中将高清图像用于精灵.我查看了文档,并下载了支持点而不是像素的最新测试版,但我不明白整个 -hd 后缀的想法.换句话说,我需要帮助,但不知道如何在我的 cocos2d 游戏中使用视网膜质量的图形.我觉得这很简单,但是我找不到任何关于这样做的东西.任何帮助将不胜感激.

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.

好吧,也许这要求太多了,但是如果有人能给我代码告诉我把它放在哪里,那将非常有帮助.(这可能问得太多了)但如果它是一条线或太多,如果你能发布它会很棒.我在这里完全一无所知.我尝试过的一件事是设置内容比例因子.图像是高清的,但在第 4 代 iPod touch 上,fps 下降到 12fps 左右.这个我真的不明白.

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.

谢谢,

泰特

推荐答案

如果您使用的是最新的测试版,您唯一需要做的更改就是以两倍大小导出所有图像并使用-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.

这篇关于如何实现高清“Retina Display"Cocos2D 中的图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何实现高清“Retina Display"Cocos2D 中的图形

基础教程推荐