Stanislav Vornetski
Stanislav Vornetski

Reputation: 1

Non-native resolution forced in the Android game. How to get native?

In order to give best experience to player, I want provide possibility to choose game resolution from low (best performance) to native (best quality). Sadly, some android devices forces game to run in decreased non-native resolution, and I found no way how to detect native resolution. For example - Samsung Galaxy Tab A 10'' (2016) - have native resolution 1920x1200, but game runs in 1440x900. Fonts and interface looks blurry and poor. It's strange, but our analytic show what about 40% this devices runs the game with native resolution. But not in my case.

So, I need solution.

First option - is to get (in some way) native resolution of the device. Screen.width/height, Screen.currentResolution - not helps. Screen.resolutions - alway empty. android.util.DisplayMetrics - also reports only decreased resolution.

Second option - restrict system (or Unity) to run the game in native resolution only. I checked Unity settings and manifest - found nothing..

Please help. Thanks

Upvotes: 0

Views: 746

Answers (1)

zwcloud
zwcloud

Reputation: 4889

What you need is adaptive UI.

If you are using NGUI, see this thread. There are many examples on how to do that. The key component is UIAnchor.

You can either make your UI modular using UIAnchor components, set the UIRoot to be manually sized (and lose pixel perfection), or you can create different layouts. One layout for the iPhone, and another for iPad, for example.

If you are using Unity3D UI, see Designing UI for Multiple Resolutions.

Upvotes: 0

Related Questions