8

I'm trying to make a level select screen for my game, but when testing the game build the ui isn't scaled that well

I'm currently using the Canvas Scaler with the following settings

Canvas scaler settings

These settings give me..interesting results to say the leastWhat actually happens

What the result is SUPPOSED to be is thisWhat I need

How am I able to do this?

1
  • I've read that there are some custom ways to do this, but no clear tutorials, how do I implement these? Commented Aug 15, 2022 at 14:34

2 Answers 2

6
+50

There a few things that you should keep in mind while building the UI for different screens.

  1. Have a target Aspect ratio. Generally it should be 16:9 for landscape and 9:16 for Portrait.
  2. Make sure the reference resolution is in line with your target aspect ratio.
  3. Set the Match option of canvas scalar to 0.5 to scale evenly. If you are sure the device aspect ratio will change in only one direction then set either height or width. For example a portrait game will scale only by height if you switch from 9:16 to 9:18.(0.5 has worked always for me)
  4. Select the aspect ratio in the game window and set the Anchors of the UI to the corner of the UI element. That way Unity will know where the element should be based on Canvas size.

Here is a video that demonstrates it https://youtu.be/08S1VGL9afg

Sign up to request clarification or add additional context in comments.

Comments

-1

First of all, use some custom resolution in game view instead of Free Aspect. Then you could try adjusting Match with Height or width to 0.5. In some case, you have to adjust custom anchors using these little guys Custom Anchors

If you want to absolutely preserve aspects, use this option on Image component. Preserve Aspect

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.