多种屏幕分辨率/纵横比(游戏) [英] Multiple screen resolutions/aspect ratios (games)

查看:25
本文介绍了多种屏幕分辨率/纵横比(游戏)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢您的所有回答和评论.在考虑之后,我将问题的核心重新表述为:如何确定和限制我的游戏能够运行的最小分辨率/比率".因为 imo 要么游戏在最小的屏幕/比例(缺乏细节)上变得无法播放,要么支持甚至最小的屏幕/比例都会显着降低所有其他游戏的体验.此外,我们甚至不知道最小分辨率是多少,或者除了禁用 ldpi 之外,还可以以任何方式限制它……这仍然没有告诉我们最小的 mdpi.毕竟我不是在考虑如何创造一个好的结果,而是在考虑如何创造一个完美的结果;).猜猜这不可能(现在?).

注意:这纯粹是关于手机而不是平板电脑此外,这个问题与应用程序无关,因为它适用于不使用 Android 布局系统的游戏.

我总是发现预期哪些决议的定义有些模糊.我知道文档中的

EDIT: Thanks for all your answers and comments. After thinking about it i would rephrase the core of the question to: "How to determine and limit the minimum resolution/ratio my game is able to run on". Because imo either the game becomes unplayable on the smallest screen/ratio (lack of detail) or supporting even the smallest screen/ratio degrades the experience for all the others significantly. Besides we do not even know what the smallest resolution is or can restrict it in any way other than disabling ldpi... which still doesn't tell us about the smallest mdpi. After all i'm not thinking about how to create a good result but about how to create a perfect result ;). Guess it's not possible (yet?).

Note: This is purely about phones not tablets Also this question is not that relevant for applications as it is for games which don't use the Android layout system.

I always found the definitions of which resolutions to expect somewhat vague. I am aware of the list in the docs.

Now my first question is if this list is complete or in other words are manufacturer allowed to use other reolutions or aspect ratios. My current approach is to view this list in terms of aspect ratios which looks something like that (Not sure if it's exact but you get the idea):

  • ldpi: smallest aspect ratio 4:3
  • mdpi: smallest aspect ratio 3:2
  • hdpi: biggest aspect ratio 16:9

So if i want to cover a range of devices i figure out what my smallest and my biggest aspect ratios are and design the layout for the smallest while making it automatically grow to the biggest. For example if i want to support all densities i design the screens for 4:3 and make it grow to 16:9. In case i remove ldpi support i would design for 3:2. Of course this assumes there will never be an mdpi device with an aspect ratio of 4:3 which brings us back to my first question.

My preferred solution would be to indicate on the Android Market which aspect ratios my application can handle but that doesn't seem possible so far.

Does anyone have a better approach? (Keeping in mind that it's for games on phones only)

解决方案

I found a clear answer to the problem.

Minimum resolutions are undefined prior to 3.0. So for 3.0 and above it will be possible to choose a minimum resolution, design a game based on it and grow the layout dynamically on larger screens/ratios as mentioned by superM and others.

As you design your UI for different screen sizes, you'll discover that each design requires a minimum amount of space. So, each generalized screen size above has an associated minimum resolution that's defined by the system. These minimum sizes are in "dp" units—the same units you should use when defining your layouts—which allows the system to avoid worrying about changes in screen density.

  • xlarge screens are at least 960dp x 720dp
  • large screens are at least 640dp x 480dp
  • normal screens are at least 470dp x 320dp
  • small screens are at least 426dp x 320dp

Note: These minimum screen sizes were not as well defined prior to Android 3.0, so you may encounter some devices that are mis-classified between normal and large. These are also based on the physical resolution of the screen, so may vary across devices—for example a 1024x720 tablet with a system bar actually has a bit less space available to the application due to it being used by the system bar.

Source

这篇关于多种屏幕分辨率/纵横比(游戏)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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