TOM
TOM

Reputation: 13

How to have my game fill the screen with the correct aspect ratio

Hello and thank you for reading my post! What my game looks like

I've created a simple layout with a Canvas and a panel and a few buttons. When I view the game in the In-Unity simulator, my project appears in the bottom left corner of different simulated phones.
Is there a way I can have my project fill the screen with the correct aspect ratio?

I tried coding the entire thing (every button and UI element independently) and I think there must be an easier solution here that I'm missing. Please help me!

I played around with the Canvas Scaler component but it didn't help. Also I tried out the Aspect Ratio Fitter but it says I can't use it because my Canvas has a fixed width and height.

Upvotes: 0

Views: 129

Answers (1)

Morion
Morion

Reputation: 10860

You just need to set up your canvas scaler properly. In most cases, it is a good practice to use some reference resolution for mobile app. For example, 1080x1920 and make all positioning according to this.

You can find an explanation in this video.

Upvotes: 0

Related Questions