- Home /
Aspect Ratios aren't displaying properly on build
I am working on a small project, testing with a Galaxy S8. I set the aspect ratio to 16:10 (portrait) and that seems fine in the game and camera view. I created a UI and added a button and scaled it to fit the screen, which it did perfectly fine like so:
(not sure what those errors are they keep occurring)
16:10 seems to be what everyone else is using, it should scale to fit the devices native resolution if I am not mistaken? I built this and opened it on the S8, this is what it looks like:
I would upload the image here but it is simply way too big, here is a link to it instead: imgur link
As you can see the button is stupidly small, like you couldn't even tap on it. This is nothing like what you see in the game/camera view. I have tried setting the resolution to match the S8, that works but you have to make everything huge, like the test and button size etc, it becomes more of a hassle.
I also don't want to use fixed resolutions because it isn't portable.
Answer by tanoshimi · Jul 26, 2017 at 05:54 PM
"Setting the aspect ratio to 16:10" in Game View (using the dropdown to the left of scale) does nothing other than alter the dimensions of the preview game view window. To make your UI scale correctly to different devices, you need to add the canvas scaler component to your canvas: https://docs.unity3d.com/Manual/script-CanvasScaler.html
Your answer
Follow this Question
Related Questions
Sprite Image size for different mobile resolutions 0 Answers
How to make my game fit into my droid? 1 Answer
Major resolution discrepancy when comparing 2 Android phones. What could be causing this? 1 Answer
Android Galaxy Nexus Resolution Question, not really 1280 x 720? 1 Answer
Building a aspect/resolution-independent 2D scene with an orthographic Camera 0 Answers