Cocos2D 2.1 及宽后缀

Cocos2D 2.1 and wide suffix(Cocos2D 2.1 及宽后缀)

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

问题描述

我有两个问题...

  • 如何在Cocos2D 2.1 中定义iPhone5 自定义后缀?没有新的方法.
  • 查看文档,我看到 suffixesDict 提到了 iPhone5iPhone5 HD.如果它始终是高清的,那么有 iPhone5 后缀有什么意义?
  • 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?

推荐答案

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

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

默认值为-widehd",在 v2.1 rc 和 beta 版本中它曾经是-iphone5hd".

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

不要问为什么会有非高清后缀-wide"——我想不出一个单一的方式为什么要使用它,而且没有没有 Retina 显示屏的宽屏设备.它可能只是由于内部代码而存在,否则会破坏为用于始终检查HD"然后回退到同一类别的SD"变体的代码.这是我可以解释它为什么存在的唯一方法.

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.

此外,如果应用在设计时考虑到宽屏,则很少需要-widehd"后缀本身.例如,您可以简单地在非宽屏设备上使用相同的宽屏背景图像,并允许在非宽屏设备上截取图像.

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 及宽后缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Cocos2D 2.1 及宽后缀

基础教程推荐