Serkan Tarakcı
Serkan Tarakcı

Reputation: 305

Scaling UI for all resolutions in Unity?

I want to create a 2D game with unity. I use anchor points and canvas scaler as everybody says in the Internet.

enter image description here

The image below shows how do I set anchors

enter image description here

However, when I create an apk for Android. It works for some mobile devices (I tested with Xiaomi, Samsung with 720p,1080p or higher resolutions) but it doesn't work well for tablets. Such as Samsung Galaxy Tab A 10.1. In the image below: left one is Xiaomi, right one is Galaxy Tab

enter image description here

In the internet everyone says it can be done using anchors and canvas scaler and they resize the Game screen and show the UI scales in Unity. Yes, it happens so in unity. But it doesn't happen so in devices. In the image below I wanted to show when I resize the Game screen in unity there is no problem about scaling. What can I do about that? I appreciate for any help in advance.

enter image description here

Upvotes: 1

Views: 1247

Answers (2)

우원진
우원진

Reputation: 199

Change the match value to 0.5 -> 1 what in canvas scaler component and reset or modify UI.

Upvotes: 0

The thing is, you can expand your UI 100% correctly only by 1 dimension - width or height. Looks like your UI suppose to preserve vertical size and can handle some free space on left and right, so change in Canvas Scaler component "Match" to Height (=1), so it will change your UI only if height is changing.

Upvotes: 1

Related Questions