|
We're currently porting our games to Android, and would like to be able to release a universal build for tablets and phones. Is there a way to determine the actual screen size or DPI in order to adjust the size of interface elements accordingly?
(comments are locked)
|
|
It took a fair bit of research, but in the end it was pretty easy. Hopefully this serves as a reasonable example of how to interact with Android's Java environment from within Unity. Brilliant. Thank you.
Mar 28 '12 at 02:32 AM
iMugen
I already try to display each of the variables, but the variables always return 0. I don't know what's wrong. Can anyone help me?? Thank you.
Apr 17 '12 at 01:00 PM
ShirleyXiao
Useful for all the other bits of information but if you just want the usable screen width and height in pixels why can't you use Screen.width & Screen.height?
Apr 17 '12 at 01:35 PM
HazeTI
(comments are locked)
|
(comments are locked)
|
|
To add to Daniel's answer, for those who do not know how to implement this script you can simply add it to the Plugins folder (in your project hierarchy, you can add one if you don't have one) and call any of DisplayMetricsAndroid() variables, for example: Debug.Log(DisplayMetricsAndroid.WidthPixels); ofcourse, it has to be used within an Android enviroment. Thanks again Daniel.
(comments are locked)
|
|
Help, apply this in te GUITexture?
(comments are locked)
|
|
really great, thanks a lot
(comments are locked)
|
1 2 next page »
