Unity Android Game Development by Example Beginner's Guide
上QQ阅读APP看书,第一时间看更新

Dynamic positioning

You are probably thinking that it is all well and good that the game is all styled now, but everything is still sitting in the top-left corner of the screen. Well then, you are in luck. That is exactly the topic of this section. It is not enough to simply adjust the numbers in our Rects until our GUI is centered. While working with the Android platform and other mobile devices, we have to be prepared for a large variety of possibilities. Not every device that our games will be played on will have the same screen size. So, you may position your GUI to be centered on your tablet, but it will be far off screen on a phone.