加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

为什么cocos2d-iphone用户应该避免使用@ 2x文件扩展名?

发布时间:2020-12-14 17:28:57 所属栏目:百科 来源:网络整理
导读:Cocos2d-iphone使用-hd扩展为Retina图像(和其他资产)。对于@ 2x来说, cocos2d Retina guide只是模糊地说出“一些不兼容性” Apple uses the ”@2x” suffix,but cocos2d doesn’t use that extension because of some incompatibilities. Instead,cocos2d h
Cocos2d-iphone使用-hd扩展为Retina图像(和其他资产)。对于@ 2x来说, cocos2d Retina guide只是模糊地说出“一些不兼容性”

Apple uses the ”@2x” suffix,but cocos2d doesn’t use that extension
because of some incompatibilities. Instead,cocos2d has its own
suffix: ”-hd”.

WARNING: It is NOT recommend to use the ”@2x” suffix. Apple treats
those images in a special way which might cause bugs in your cocos2d
application.

大。我感觉很好。

通过2-year old bug report regarding @2x,我得到了一个forum thread that supposedly explains the issues with @2x的链接。但是没有。我在那里发现的唯一提示是有关于@ 2x的iOS(4.0 / 4.1)错误,我认为不再相关。可能我可能错过了一些关键的方面(有一些关于缓存或重复加载问题的讨论) – 线程很久以来。

我想知道cocos2d开发人员遇到什么具体问题,如果他正在使用@ 2x后缀的图像而不是-hd?

请给出具体的可能出现或实际上会出错的例子。

这似乎是这个链接的主要原因: http://www.cocos2d-iphone.org/forum/topic/12026

具体这个帖子由riq:

I don’t know if initWithContentsOfFile was fixed,but in 4.0 it was broken and it wasn’t working with @2x,~iphone extensions.
imageNamed caches all the loaded files so it consumes much more memory than initWithContentsOfFile
Also the @2x extension does something (I don’t know exactly what) but it doesn’t work OK with cocos2d.

另一个好点:当iPhone 4刚刚与视网膜显示器一起发布时,我确信Cocos2D的一些用户正在使用旧版本,因此当用户在不支持的Cocos2D版本上使用视网膜显示器时事情是他们应该是两倍。再次,除非您使用的是非常早期的Cocos2D版本,否则现在已经解决了这个问题。

概述,所以似乎主要的问题是从iOS 4的initWithContentsOfFile,但他们已经解决了这个,因为我在我的应用程序中使用了Cocos2D 2.0-rc2的确切的API,我没有任何问题。我使用所有Apple指定的扩展图像,一切工作快乐好!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读