Xcode 6 - 用于通用图像支持的xcassets [英] Xcode 6 - xcassets for universal image support

查看:90
本文介绍了Xcode 6 - 用于通用图像支持的xcassets的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前正在开发一个通用的SpriteKit项目。我将支持以下设备:

Currently working on a universal SpriteKit project. I'll be supporting the following devices:

iPhone 4 / s,
iPhone 5 / c / s,
iPhone 6,
iPhone 6 +

iPhone 4/s, iPhone 5/c/s, iPhone 6, iPhone 6+

iPad不退,
iPad视网膜

iPad non-ret, iPad retina

我对iPhone部分感到困惑。对于iPhone的4种不同屏幕分辨率,我的背景精灵已经有4个版本。但是哪个呢?

I am confused on the iPhone part. I already have 4 versions for my background sprite for the 4 different screen resolutions of the iPhones. But which goes to which?

我知道3x适用于6+,我认为5 / c / s是Retina 4 2x,但是我知道不知道iPhone4 / s在哪里,而且6去了。谁知道?

I know the 3x is for the 6+, and I think the 5/c/s goes to the Retina 4 2x, but I do not know where the iPhone4/s, and 6 go. Anyone know?

旁注,当我在我的xcassets文件中创建一个Launch Image时,我会看到这些选项,它基本上包含了我支持的所有设备。只是想知道为什么在创建图像集时也不是这种情况

Side note, when I create a Launch Image inside my xcassets file, I am shown these options, which basically has all the device I am supporting. Just wondering why this is not also the case when creating an Image Set

另外,你们如何为通用应用程序创建图像/精灵?现在新的iPhone 6和6 plus已经出来了,我还有2个支持的分辨率,这对我来说仍然很困惑,因为我还是初学者。

Also how do you guys approach creating images/sprites for a universal application? Now that the new iPhone 6, and 6 plus are out, I have 2 more resolutions to support which is still confusing for me as I'm still a beginner.

推荐答案

这有点令人困惑 - 这是我理解的方式(这是参考顶部图片):

This is a little confusing - here's how I understand it (this is in reference to the top image):


  • 1x 图片适用于原始iPhone通过3GS - 标准分辨率设备(3.5英寸屏幕)

  • 1x images are for the original iPhone through the 3GS - 'standard' resolution devices (3.5" screens)

2x 图像适用于iPhone 4和4S(3.5英寸Retina屏幕),也可用于iPhone 6.

2x images are for the iPhone 4 and 4S (3.5" Retina screens) and are also used for the iPhone 6.

Retina 4 2x 适用于iPhone 5和5s(4英寸Retina屏幕)

Retina 4 2x are for the iPhone 5 and 5s (4" Retina screens)

3x 图片适用于新款iPhone 6+(5.5英寸超级Retina [3x]屏幕)

3x images are for the new iPhone 6+ (5.5" super-Retina [3x] screen)

我相信iPhone 6(4.7英寸屏幕)将使用Retina 4 2x图像,但我必须测试它。

I believe that the iPhone 6 (4.7" screen) will use the Retina 4 2x images, but I would have to test it.


旁注,当我创建一个Launch Imag在我的xcassets文件中,我显示了这些选项,它基本上包含了我支持的所有设备。只是想知道为什么在创建图像集时不是这种情况

Side note, when I create a Launch Image inside my xcassets file, I am shown these options, which basically has all the device I am supporting. Just wondering why this is not also the case when creating an Image Set

如果比较两个图像,较低的图像具有上面一个,除了1x iPhone图形。如果您只支持iOS 7及更高版本,则不需要,因为iOS 7不能在任何非Retina手机设备上运行。说实话,我不明白为什么顶部图像有1x iPhone表格图形选项 - 可能是因为你选中了侧边栏中的iPhone框?

If you compare the two images, the lower one has everything the upper one does, except for a 1x iPhone graphic. You don't need that if you're only supporting iOS 7 and above, since iOS 7 doesn't run on any non-Retina phone-form devices. To be honest, I don't understand why the top image has a 1x iPhone form graphic option - maybe because you checked the "iPhone" box in the sidebar?


另外,你们如何为通用应用创建图像/精灵

Also how do you guys approach creating images/sprites for a universal application

对于大多数非全屏图像(像徽标一样,你真的只有 3 分辨率支持 - 标准(1x),Retina(2x)和iPhone 6+(3x)。这些只是图像的不同质量,而不是真正不同的大小。因此,如果您在标准设备上拥有10x10图像,则意味着您需要在Retina设备上使用20x20图像,在iPhone 6+上使用30x30图像。在所有设备上,它们将显示为10x10图像。

For most non-fullscreen images (like a logo), you really only have 3 resolutions to support - standard (1x), Retina (2x), and the iPhone 6+ (3x). These are simply different quality of images, not really different sizes. So if you have a 10x10 image on a standard device, that would mean you need a 20x20 image on a Retina device and a 30x30 image on an iPhone 6+. On all devices, they would show up as a 10x10 image.

我用来管理不同图标分辨率的一个很棒的工具是 iConify

A great tool I used for managing different resolutions of icons is iConify.

我创建它们是最高的我需要的尺寸(对于我希望在设备上为10x10的图像,为30x30 [@ 3x]),然后将其保存为png并将副本调整为20x20 [@ 2x]和10x10 [标准]。一个更好的解决方案是创建和使用矢量图形,这将是调整大小到任何大小。

I create them at the highest size I need (30x30 [@3x] for an image I want to be 10x10 on a device), then save it as a png and resize copies to 20x20 [@2x] and 10x10 [standard]. A better solution would be to create and use vector graphics, which would resize better to any size.

这篇关于Xcode 6 - 用于通用图像支持的xcassets的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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