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

查看:15
本文介绍了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 文件中创建启动图像时,我会看到这些选项,这些选项基本上包含我支持的所有设备.只是想知道为什么在创建图像集时不是这种情况

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 英寸超视网膜 [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.

旁注,当我在我的 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.

我以我需要的最大尺寸创建它们(30x30 [@3x] 用于我希望在设备上为 10x10 的图像),然后将其保存为 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天全站免登陆