- Home /
Background and UI scalings are wrong
Hello,
First, I know I can use "Scale with screen size" and "Screen match mode", I'm actually already doing it but I'm facing an issue. I never have the same images. I let you take a look.
Here is the "#Scene" overlay:
Here is the "Game" overlay:
Here is the same scene on the build of the game:
Here are the setting of my scene:
Render mode: "Screen Space - Camera. I put my only camera inside below.
UI Scale Mode: "Scale With Screen Size"
Reference resolution: 1920*1080 (my screen size)
Screen Match Mode: "Expand"
Background image is a gameobject UI image inside the canvas such as the white button.
Should have any idea, please feel free to share, this starting to drive me crazy! Of course, if you need further information, feel free to ask! :)
Answer by jchester07 · Oct 12, 2017 at 02:48 AM
First, Go to your Game tab in unity. As you can see on the upper right beside the game tab, it is set to free aspect. Change it to 1920*1080. I believe that resolution is not there by default so you can add it yourself. Then you can see how the actual build would look like.
Hi jchester07,
Thanks for your help, it works! At least the "Game" overlay and the game are the same. It doesn't match with "#Scene" but I can deal with that! :) I have another question if I may. With this configuration, what will happen if the player has a 720p resolution or a smartphone?
$$anonymous$$ake sure you set the anchors of your image right. In your case, it should be set to stretch on all corners. On your canvas scaler, set it to "match width or height" with match set to 0.5. If the device has higher or lower resolution, it would scale matching the aspect ratio of what you set in your reference solution. If the target device has a different ratio, there will be black portions either on top and bottom or on the sides of the screen.
Your answer
Follow this Question
Related Questions
Stretching Background sprite 4 Answers
Best way to move elements around screen [uGUI] 0 Answers
UI Texture Max Size (inspector) 1 Answer
Problem with fixed Resolution and UI anchoring 2 Answers
Unity Scene View has other Resolution then Game View. 0 Answers