Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
0
Question by whiteant54 · Mar 17, 2015 at 09:21 PM · uitextcanvasscreen resolutionmainmenu

Unity 5 UI GUI Text Canvas Screen Resolution Adaption Problem

Hi, I want to have a UI Text with Canvas child (which is default). I would like it to be that when the screen resolution changes, it also fixes the text to fit. So, for short, for the text to fit any sized computer screen. I am making a main menu. Here are some pictures:

file:///C:/Users/anthony/Pictures/Screenshots/Screenshot%20(4).png file:///C:/Users/anthony/Pictures/Screenshots/Screenshot%20(5).png

The first one is full screen. The second one is a smaller screen. (Note how you can't see the text. The text is still there.) My goal is to be able to see the text even in the small screen. I am open to script(C# if possible) and also configurations (ex: Components) Whatever works. If you do provide script, please explain what object to attach it too as well as description. 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
8

Answer by DiegoSLTS · Mar 19, 2015 at 12:08 AM

Don't do what you suggested, is a really unflexible way of doing what you want.

Checkout the "UI scale mode" property of the Canvas Scaler component in your Canvas game object. It defaults to "Constant pixel size", a really bad option if you aim to more than one resolution, a window of 640x480 will only show a 640x480 rectangle from the top left corner of your canvas.

Change the UI scale mode to "Scale with screen size" and unity will shrink or expand your Canvas to best fit in your screen.

Comment
Add comment · Show 1 · 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 Owlbear_Headspin · Mar 15, 2018 at 01:45 AM 0
Share

This totally worked for me. Thanks for the tip!

avatar image
4

Answer by whiteant54 · Mar 18, 2015 at 11:55 PM

FOR ANYONE WHO HAS THE SAME PROBLEM, LISTEN CLOSELY. ALL YOU NEED TO DO IS: Canvas -> "Your Text" -> Settings sign on the top right -> Reset

Then Under Rect Transform You: Anchors -> Min X: 0, Min Y: 0.5, Max X: 0, Max Y: 0.5

Then You: Pivot X: 0, Pivot Y: 0.5

When you do so, the top left square in rect transform should say on top: Left, and on the side: Middle. Then you may move your text/buttons anywhere you like. (Note: Anywhere in the canvas.) Make sure your Scale is X: 1, Y: 1, Z: 1. To resize your text, use the font controller. If you follow my instructions, when you play your game, (in the editor to test) you should be able to change the ratio from your game view to Free aspect, 5:4, 4:3, etc without losing view of your GUI text/buttons/image/etc. (PLEASE NOTE: Maximize on play MUST be selected.

Hope this helped since I know this is a big problem and I even had this problem myself.

Happy developing :)

Comment
Add comment · Show 1 · 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 tperezstolfa · Jun 08, 2017 at 10:24 PM 0
Share

Thanks man, I was going crazy heh

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Canvas UI Priority layers 1 Answer

Quick Question on UI Text Alignment 1 Answer

How to display UI Text on GameObject in script? 0 Answers

screen resolution and canvas UI 1 Answer

How to add total quantity of a score after the changing score Int? 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