Forum rules - please read before posting.

UI canvas expanding beyond the camera's boundaries

edited October 1 in Technical Q&A

For convenience, I want my game to always render at 16:9 (1.778 aspect ratio). I set the camera settings, set the menu settings, set the canvas settings, but for some reason the UI of every menu still expands over the whole screen instead of being contained within the 1.778 aspect ratio.
this happens:

  • while playing in editor mode with a free aspect ratio window
  • on the android build phone and tablet)
  • on the windows build with "windowed" render and "resizeable window" turned on (if I change the window size to anything different than 16:9, the UI gets clipped)
  • on the windows build with "fullscreen" render

here's my:

I also noticed that in the windows build, even when the UI buttons are completely outside the visible area, they're weirdly still clickable

any idea what I'm missing?
I'm with unity 2021.2.14, AC 1.81.6

Comments

  • When Unity UI is used for Menu rendering, they won't - by default - be aware of the game's aspect ratio, which is different to that of the screen/window.

    Fixing this is a case of using the Auto-correct UI dimensions component to have it scale / reposition itself properly.

    See the Manual chapter by the same name for details, but AC's default UI prefabs also make use of this - you can check to see how they get used as well.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.