Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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
1
Question by ohjhesus · Jan 02, 2016 at 08:33 AM · uiguicanvasresolutionscaling

UI not scaling correctly with screen resolution

When I run my game in the editor and change the resolution using the editor dropdown, everything works fine

(1280x800)alt text

(720x450)alt text

The window also resizes correctly when I build my game and exit fullscreen.
However, when I switch to fullscreen from ingame, the UI does not scale with the screen size unless I set the resolution to the native resolution. (not allowed any more pictures, sorry about link.)

Album

Canvas settings

Part of fullscreen/resolution change script:

 void ChangeSettings () {
         //...
         StartCoroutine (Fullscreen (isFullscreen)); //isFullscreen = Player Pref
         //...
     }
 
     private IEnumerator Fullscreen (bool fullscreen) {
         int width = Mathf.FloorToInt (resolution.x); //Player pref resolution
         int height = Mathf.FloorToInt (resolution.y);
         Screen.fullScreen = fullscreen;
 
         yield return new WaitForEndOfFrame ();
         yield return new WaitForEndOfFrame ();
 
         Screen.SetResolution (width, height, Screen.fullScreen);
     }
screen-shot-2016-01-02-at-114718-am.png (440.4 kB)
screen-shot-2016-01-02-at-114727-am.png (269.8 kB)
Comment
Add comment · Show 4
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 crypt0 · Jan 07, 2016 at 10:11 PM 0
Share

I have the same problem - any solutions?

avatar image crypt0 · Jan 07, 2016 at 10:25 PM 0
Share

I got this problem, if the OS resolution bigger than the game resolution on fullscreen. When I switch the windows resolution to 1280x720 and then start the game with a resolution of 1280x720 or 1920x1080, it works correctly

avatar image ajaybhojani · Jan 08, 2016 at 05:07 AM 0
Share

try to set custom anchor of parent panel of canvas and all underlying stuff...

avatar image wlad_s · Jan 20, 2016 at 01:47 PM 0
Share

Same here. It worked fine this morning before I updated Unity to 5.3. I've tried different "cheats". I've made a coroutine which switches the resolution, then disables/enables canvas scaler component, or change some parameters. I did it in hope that the changes will trigger it to "refresh". But it didn't help :(

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by wlad_s · Jan 20, 2016 at 02:05 PM

As karl.jones says here: http://forum.unity3d.com/threads/canvas-scaler-broken-in-unity-5-3-1f1.380809/

This is fixed in 5.3.1p3. http://unity3d.com/unity/qa/patch-releases

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

6 People are following this question.

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

Related Questions

Good way to scale 3D GameObjects in a Canvas (Screen Space - Camera)? 1 Answer

Scaling GUI correctly according to game window resolution? 1 Answer

Ui elements not scaling correctly 0 Answers

2d image does not scale/stretch correctly 2 Answers

Canvas with GUI elements in prefab act strangely 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