1

I am making a game and have a problem with UI. I made it to scale with the screen size. In 16:9 it looks as I want to: UI is where I want it to be.

But when I switch to 2160 x 1080 I have a problem. My UI is outside my game screen

I want that my UI on 18:9 stays in the same position as in 16:9. Any solutions to make it stay inside game bounds?

Mitrand
  • 13
  • 3

2 Answers2

1

Canvas object -> Canvas Scaler component:

Scale With Screen Size Match = 0 (0 for vertical app, 1 for landscape)

And then you need to change anchors for ui objects to align not from borders, but from center.

Whitebrim
  • 396
  • 2
  • 9
  • If you have vertical game then Size Match = 0. You need to change anchors for ui objects to align not from borders, but from center – Whitebrim Jul 26 '20 at 10:25
0

If you want UI to cover entire page make sure you hold shif + alt and select the stretch preset Unity will always cover the entire screen irrespective to resolution

Unity anchor preset

refrence

Pranav Mehta
  • 144
  • 1
  • 5