全屏图像和 Android 分辨率
我有一个在背景中显示全屏图像的游戏。目前我只有一种图像尺寸(1280x800)。这在大分辨率下效果很好,但在较小的屏幕上,缩小会稍微降低图像质量。您可以看到锯齿状边缘,这明显比使用 Photoshop 软件所能达到的效果要差。
我有不同的图像尺寸,但我不确定如何使用它们。我知道有不同的 dpi 文件夹,但您可以使用相同 dpi 的 480x320 和 1280x768 分辨率,所以我认为这些在这里用不上。
我相信您可以针对不同的屏幕尺寸使用不同的布局文件,但图像不是使用 xml 绘制的(事实上对于我的游戏来说这是不可能的)。
我只能认为我必须为每个尺寸创建不同的文件名。然后,在选择要使用的图像时,我可以获取屏幕尺寸并选择正确的图像吗?我正在努力了解如何使图像在 240x320 和 1280x800 分辨率下看起来都不错。
I have a game which displays a full screen image in the background. At the moment I have one image size (1280x800). This works well on large resolutions but on smaller screens the shrinking somewhat degrades the image. You can see jagged edges and it is noticeably worse than what you could achieve using photoshop software.
I have different image sizes, but I am unsure how to utilize them. I know there are different dpi folders, but you can have resolutions of 480x320 and 1280x768 with the same dpi so I don't think these can be of use here.
I believe you can have different layout files for different screen sizes, but the image is not drawn using xml (and in fact would not be possible for my game).
I can only think that I must create a different file name for each size. Then when choosing which image to use I could take the screen dimensions and select the correct one? I am struggling to see how I can make an image look good on both 240x320 and 1280x800 resolutions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
框架中的所有资源限定符都可以应用于可绘制对象,而不仅仅是 dpi 指示符。换句话说,您也可以创建这样的文件夹来分割图像:
甚至像这样的示例也可以工作...
等等。 ..
您可以根据需要为图像资产创建任意数量的不同合格目录以保持质量。 SDK 文档中的支持多个屏幕文章帮助描述了大多数最适合的限定符适合缩放图像资源。
哈!
All of the resource qualifiers in the framework can be applied to drawables, not just the dpi designators. In other words, you could create folders like this to segment your images as well:
Even examples like these work...
And so on...
You can create as many or as few different qualified directories for your image assets as you think necessary to preserve the quality. The Supporting Multiple Screens article in the SDK docs helps describe most of the qualifiers that best fit scaling image assets.
HTH!