支持 iOS 当前使用的多种艺术尺寸的最佳方式是什么?

发布于 2024-09-08 09:54:36 字数 633 浏览 1 评论 0原文

目前 iOS 支持三种不同的艺术尺寸:480x320 原始 iPhone 屏幕的艺术、高分辨率 960x640 iPhone 4 屏幕的艺术和 1024x768 iPad 屏幕的艺术,根据我的经验,这通常与高分辨率不同。由于对屏幕长宽比的不同要求。

在最坏的情况下,您可以为所有艺术品添加三种尺寸,而这正是我为上一款游戏的主要元素(卡片)所做的。然而,这最终浪费了下载时间和我创建它们的时间。

对于处理不同 iDevice 的不同要求的最佳方法,你们有何建议?以下是我正在考虑的一些一般可能性:

  1. 包含所有 3 种尺寸的图稿。

  2. 仅包含 1 种尺寸(大尺寸)的图稿,但在创建 UIImage 时即时调整其大小。

    仅包含 1 种尺寸(大
  3. 仅包含 1 种尺寸(大尺寸)的图稿,但在用户第一次启动您的应用时制作调整大小的副本。

    仅包含 1 种尺寸(

当然,存在涉及仅针对某些尺寸使用某些技术的变体(例如,在两个大尺寸之间共享图稿,根据需要稍微调整大小)。我对您会使用哪种方法感兴趣,并附上有关这样做的优点和缺点的说明。我预计最大的缺点是:文件大小以及对象显示或调整大小时可能导致的任何滞后。我最大的未知数之一是,如果你让 iOS 来调整大小,无论是在输出质量还是在时间上,它的工作效果如何。

Currently iOS supports three different art sizes: art for the 480x320 original iPhone screen, art for the hi-res 960x640 iPhone 4 screen, and art for the 1024x768 iPad screen, which in my experience is usually not the same as for the hi-res screen because of the different demands placed upon the different aspect ratio of the screen.

In a worst case, you could include three sizes for all of your artwork, and that's exactly what I did for the main element (cards) of my last game. However, it's ultimately wasteful in both download time and my time in creating them all.

What would y'all suggest as the best way to deal with the different requirements of the different iDevices? Here's a few general possibilities that I'm considering:

  1. Include artwork in all 3 sizes.

  2. Include artwork in just 1 size (the big one), but resize it on the fly as UIImages are created.

  3. Include artwork in just 1 size (the big one), but make resized copies of it the first time a user starts up your app.

There are of course variants involving using some techniques for just some sizes (e.g., share artwork between the two big sizes, slightly resizing as needed). I'm interested in which method you'd use, with notes on the pros and cons of doing so. I expect the biggest cons are going to be: file size and any lag that might be caused in display or resizing of the objects. One of my biggest unknowns is how good of a job iOS does if you let it do the resizing, both in output quality and in timing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜宝宝 2024-09-15 09:54:36

我目前正在使用所有 3 种尺寸的艺术品。如果您的图稿采用矢量格式,并且是针对 iPhone 和 iPad 的宽高比设计的,那么只需简单的批量操作即可同时创建所有 3 种作品。

如果您只包含最高分辨率,则内存使用可能会成为内存较少的旧版 iOS 设备的问题。图像质量和调整大小的速度不是问题,因为如果您让操作系统调整图像大小,则两者都非常好。对我来说,我不想有额外的代码来处理为不同设备调整同一图像的大小。否则,听起来好像只有大型艺术品并确保其大小调整正确就可以了。

I'm currently using artwork in all 3 sizes. If your artwork is in vector format and designed for both the iPhone and iPad aspect ratios, it's a simple batch action to create all 3 at the same time.

If you just include the highest resolution, the memory usage might be a problem with older iOS devices which have less memory to work with. The image quality and speed of resizing is not an issue, since both are excellent, if you let the OS resize the images. For me, I don't want to have additional code to handle resizing the same image for different devices. Otherwise it sounds like having just the large artwork and making sure it's resized correctly will be fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文