Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
6
Question by HPVal · Apr 24, 2015 at 03:15 PM · uiresolutionscreenfullscreenratio

Unity 5 UI Fill Any Screen

Hello.

I have gone through the tutorials about UI and have been working with it since it came out but I can't seem to find a way for it to fill any screen resolution. How can I make it work for all aspect ratios?

Thank you.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
13
Best Answer

Answer by DoTA_KAMIKADzE · Apr 24, 2015 at 03:21 PM

You should use "Scale with screen size" in your CanvasScaler componenet of your main UI canvas.

You might also want to check my few other answers related to your questions:

  • About resolution and aspect ratio.

  • UI size

  • You can find few more by clicking on my nickname or here.

P.S. Also I'd recommend to use "Screen match mode" - Expand to work properly with different aspect ratios, but you can use match width/height as well depending on which resolutions you will support.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image HPVal · Apr 24, 2015 at 06:11 PM 0
Share

I already use the "Scale with Screen Size" and as I have noticed resizes everything within the canvas to the screen size. However it doesn't exactly have the result I want. I have everything anchored and even set a reference resolution to a 16:9 ratio. Here's a screenshot of how my canvas looks in two different situations:

Correct one: alt text

Incorrect one: alt text

I want my bg image (brown) to cover the whole screen and the notebook to stay in place. Do I have to do something else?

untitled.png (256.1 kB)
untitled1.png (204.1 kB)
avatar image DoTA_KAMIKADzE HPVal · Apr 24, 2015 at 06:27 PM 2
Share

Anchor your notebook to center-right.

Set your background to stretch to the canvas size (aka each anchor on each corner of canvas).

Consider checking the links that I've provided in my answer.

avatar image OGNE DoTA_KAMIKADzE · Sep 06, 2018 at 05:14 AM 0
Share

Thnx Sir..worked perfect for me

avatar image HPVal HPVal · Apr 24, 2015 at 08:28 PM 0
Share

Thank you it worked :) at least for expected aspect ratios.

avatar image AstroSquid · Dec 02, 2015 at 05:37 PM 0
Share

This worked for me, thank you.

avatar image
7

Answer by InfernoZYB · Apr 24, 2015 at 03:24 PM

DoTA_KAMiKADze has got the right answer but I will post some images to help direct you:

First Select you're Canvas. alt text

Then on the inspector it should look like this. alt text

Change that to this. alt text

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Screen.SetResolution doesn't work when the game starts windowed? 0 Answers

Need some help regarding UI layout in different Screen resolutions 1 Answer

Making objects be at size and place for every phone size 2 Answers

UI and resolution problems (fine in editor, problem in Android build) 1 Answer

Change resolution, but not screen size. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges