Cocos2D 2.1和宽后缀 [英] Cocos2D 2.1 and wide suffix

查看:167
本文介绍了Cocos2D 2.1和宽后缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个问题...




  • 如何在Cocos2D 2.1中定义iPhone5自定义后缀? code>和 iPhone5 HD 。 c $> >解决方案

您必须直接修改 suffixesDict NSMutableDictionary才能更改宽屏后缀。按照 setiPadSuffix 方法的示例。



默认值为-widehd iphone5hd在v2.1 rc和betas。



不要问为什么有一个非高清后缀-wide - 我不能想到一个单一的方式为什么会想要使用它,没有没有Retina显示器的宽屏设备。它可能简单地存在由于内部代码否则破坏作为代码用于总是检查高清,然后回退到同一类别的SD变量。这是我可以解释为什么它存在的唯一方法。



此外,如果一个应用程序设计得很好,宽屏设计的-widehd后缀本身很少需要。例如,您可以在非宽屏设备上使用相同的宽屏背景图片,并允许在非宽屏设备上截断图片。


I have two questions...

  • How in Cocos2D 2.1 I define iPhone5 custom suffix? There is no new method for it.
  • Looking at docs I see suffixesDict which is mentioning iPhone5 and iPhone5 HD. What is the point to have iPhone5 suffix if it's always HD anyway?

解决方案

You will have to modify the suffixesDict NSMutableDictionary directly to change the widescreen suffix. Follow the example of the setiPadSuffix method.

The default is "-widehd" and it used to be "-iphone5hd" in v2.1 rc and betas.

Don't ask why there's a non-HD suffix "-wide" - I can't think of a single way why one would want to use that, and there's no widescreen device that doesn't have a Retina display. It may simply exist due to internal code otherwise breaking as the code used to always check "HD" and then fall back to the "SD" variant of the same category. That's the only way I can explain why it exists.

Furthermore the "-widehd" suffix in itself should be rarely needed if an app is well designed with widescreen in mind. For example you could simply use the same widescreen background image on non-widescreen devices, and allow the image to be cut off on non-widescreen devices.

这篇关于Cocos2D 2.1和宽后缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆