Universal screen resolutions in Unity for Android

余生颓废 提交于 2019-12-25 02:59:32

问题


I am new to Android development. I sent my app for testing on a couple of devices and a couple were fine, but a couple had the game half way off the screen. In the game scene everything is fine so what could be causing this in some devices?

I am using one main camera set to orthographic and it is a simple 2d game.

I guess one of my mistakes was not using the canvas properly and so I will make improvements, but why would this be like this in the game scene where I cannot use a canvas? Do I have to fix the position of main camera also?

Thankyou for help with this.


回答1:


Try playing around with your canvas' screen match mode. I would try the expand or shrink option. This is pretty self explanatory, it will either shrink or expand your canvas to match the width or the height (depending on your settings for the canvas) of your display. If you're stuck, take a look at the doc for the canvas:

http://docs.unity3d.com/Manual/script-CanvasScaler.html

And the last thing is to play around with your UI elements' anchor positions. Here's the doc for the anchor positions:

http://docs.unity3d.com/Manual/UIBasicLayout.html

Hope this helps!



来源:https://stackoverflow.com/questions/33054680/universal-screen-resolutions-in-unity-for-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!