Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
This question was closed Apr 18, 2016 at 06:55 AM by KdRWaylander for the following reason:

The question is answered, right answer was accepted

avatar image
2
Question by avanti534 · Apr 11, 2016 at 07:39 AM · resolutionfont size

Change font-size according to resolution

I am currently developing a game off of a tutorial, the game is called laser defender and your goal is to shoot down enemies. The game seemed to be working fine in the inspector, but when I did a build of the game, and set my resolution to my computer's resolution, this happened: alt text

The text was tiny and some of the buttons would not work, Is there a way to fix this? I still pressed the play button, and the enemies seemed to be the same size, and were still working fine, one the UI elements were messed up.

if you could show me a way to fix this, it would be great! Thank you!

2016-04-10-4.png (417.7 kB)
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

3 Replies

  • Sort: 
avatar image
9

Answer by Ali-hatem · Apr 11, 2016 at 12:18 PM

in cnavas make sure Canvas Scaler is Scale With Screen Size se doc Canvas Scaler

Comment
Add comment · Show 2 · 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 KdRWaylander · Apr 14, 2016 at 12:36 PM 1
Share

I do agree with that solution !

Then it will look as it looks in the game window in Unity, whatever the resolution is. For a future project brows your Game Window resolution through all the different resolution to make sure your UI will always have the desired aspect. You should work in "Standalone" or X:Y resolution in your Game window ins$$anonymous$$d of "Free Aspect"

avatar image Ali-hatem KdRWaylander · Apr 14, 2016 at 12:56 PM 0
Share

thank for converting .

avatar image
0

Answer by pradeepBee · Apr 11, 2016 at 11:12 AM

You can check 'BEST FIT' checkbox for the text fields in inspector to fix this.

Comment
Add comment · Show 3 · 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 Le-Pampelmuse · Apr 14, 2016 at 09:55 AM 1
Share

That is not correct. Best fit will not automatically scale elements according to screen resolution.

avatar image pradeepBee Le-Pampelmuse · Apr 14, 2016 at 10:02 AM 0
Share

Thanks for the reply. I gave the best fit option to adjust the text size in the text fields.

avatar image KdRWaylander Le-Pampelmuse · Apr 14, 2016 at 12:35 PM 0
Share

Indeed, it will maximize the text size IN THE TEXTBOX. If your textbox is very small (like in your screenshot) you need to ajust the size of the text element and THEN use best fit.

avatar image
0

Answer by KaushikRahul · Apr 11, 2016 at 12:23 PM

You can set your Canvas' "UI Scale Mode" under "Canvas Scaler" to "constant physical size"

it makes the UI elements maintain their original size. so they remain the same size even if the resolution changes.

and then you can use "Best Fit" for Text component which will make it appear better on the screen.

Comment
Add comment · Show 10 · 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 avanti534 · Apr 13, 2016 at 10:59 PM 0
Share

Thank you for your comment! it worked, Thank you soo much! I am having one other problem though: when I change "UI Scale $$anonymous$$ode" to "constant physical size", it changes all of the buttons that i have to big Xs, making me redo all of them, is there a quick way to fix this?

Thank you

avatar image KaushikRahul avanti534 · Apr 14, 2016 at 06:37 AM -1
Share

There is on more way you can do it.

Set your Canvas' "UI Scale $$anonymous$$ode" to "Constant Pixel Size"

then on the text or button or whatever you want to place just change the "Anchor Presets" as per your need.

i tried uploading the screens, but am not being able to. Some Unity's website issue.

Sorry.

avatar image Le-Pampelmuse avanti534 · Apr 14, 2016 at 09:53 AM 3
Share

Yes, change it to "scale with screen size." You don't have to redo all your buttons.

Constant Physical Size keeps the same overall size even if the screen gets to small. Hence the name and it is useless for your task.

Constant Pixel Size is essentially the same and also useless for your task.

Use Scale with Screen Size and type in your desired apect ratio (16:9, 4:3 16:10 etc..) This way your elements will look the same on a 100" tv monitor and a 3" smartphone screen.

PS: If you don't want to set the reference resolution to small values like 16:9, use the full equivalent resolution, like 1600x900 or 1920x1080. Some people prefer it this way, but there is literally no difference since they are all the ratio 16:9.

avatar image Ali-hatem Le-Pampelmuse · Apr 14, 2016 at 11:00 AM 1
Share

@Le Pampelmuse that's what i suggested but with your explanation hop it's clearer now & i wish from those whom not sure about there answers to test in unity before misleading others .

Show more comments
avatar image avanti534 · Apr 22, 2016 at 10:39 PM 0
Share

Hi, this has worked really well in my previous project, but when I tried it in my new project, it wouldn't work. I tried to put a image on here but it wouldn't upload. Essentially it looked like my project was in the middle of the screen, and a bunch of black space was to the left and right of it. Is there a way to fix this? I also noticed that the UI elements are fine on any resolution if the game is windowed. Is this a glitch in unity [I have tried getting 4.3.4], or could it be a setting that I have not checked [I created a new project, so there might be something unchecked by default]. If there is a way to fix this, please tell me, Thank you!

Add on:

I tried to mess around with it a little more, and i found out that the smaller the resolution, the smaller the black space. At the resolution of 1920X1080 the black space is completely gone. I have never had this problem before, this happens with "constant pixel size" and "scale with screen size".

Follow this Question

Answers Answers and Comments

7 People are following this question.

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

Related Questions

Making a pixelation shader to change resolutions in different areas of the screen 0 Answers

Changing Resolution in game messes up UI and Mouse Input 0 Answers

Tree creator Optimised Material texture resolution is low 1 Answer

Terrain Blocky Brush Resolution 1 Answer

How to Remove the black bar at my game window? 0 Answers


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