|
Post by britannis on Jan 27, 2016 14:43:21 GMT
I have my Canvas set to Scale with Screen Size and I have anchors set up for my UI elements. They look great in 16:9 aspect ratio. When I change the ratio to 5:4, the UI overlaps the game area. Ideally, the game area and UI would both scale to the smaller screen size, but I'm not sure how to accomplish this. Any ideas?
|
|
|
Post by Admin on Jan 29, 2016 20:07:53 GMT
The Sorted Shop post's project handles this kind of problem. The way I generally approach it is that I design the interface so that the menus look good in the smallest vertical aspect ratio that I wish to support. Then I use a "Canvas Scaler" script with a scale mode of "Scale With Screen Size" and a specified reference resolution (whatever you want here). The screen Match mode is set to "Match Width Or Height" and I drag the slider all the way to "1" which means that it relies only on "Height".
Note that this approach makes sure that your content will scale up or down to fill the vertical space allowed, but could cause extra room or cropping on the sides as the aspect changes. Flexible UI is a tough subject and there are many approaches, but play around with it and you should find something you like with Unity's UI tools.
|
|