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 /
avatar image
0
Question by AlexPan4 · Feb 17, 2017 at 09:12 AM · uiresolutionanchor

Problem with fixed Resolution and UI anchoring

I have a problem when it comes to ui anchoring and fixed resolution. In my example I have 2 buttons one anchored at the top of the screen and and one at the bottom. The Canvas has Canvas scaler (Scale with UI size) match height 1. Reference resolution 1024x640 alt text

So in the first image where I use aspect ratio 16:10 everything works as it should, i.e. the buttons are anchored at the top and bottom of the screen. But something strange happens when I change the resolution to 1024x640 as we see in the second image alt text

First thing we see is that for some reason the scale of the game view becomes 0.93. But when I set it to 1 which is what I see when I build the game. The buttons are cut off the screen. Why is that happening?

UPDATE** It seems that this problem does not appear on every device. My laptop has screen resolution 1366x768 and the UI at the WEBGL still has the problem. I tried it on a computer with 1920x1080 resolution and the UI was fine.

16-10-ratio.png (12.3 kB)
fixedresolution.png (25.1 kB)
Comment
Add comment · Show 6
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 JaredHD · Feb 17, 2017 at 01:49 PM 0
Share

$$anonymous$$ake sure you build your UI in the largest possible screen size you want (also start setting it up when you decide on a Sutible screen size.) From there set the Canvas Scaler to "scale with Screen size" and set "$$anonymous$$atch" to 0.5. $$anonymous$$ake sure the Reference Resoloution is the biggest resolution you want and make sure your Display is set to that resolution. Test and see if that works

avatar image AlexPan4 JaredHD · Feb 17, 2017 at 04:52 PM 0
Share

The largest possible screen I want is 1024x640 and the Display is 1024x640 (it is a WebGL project) and I have set Canvas Scaler to "Scale with Screen Size" but with "$$anonymous$$atch" 1 but that does not solve my problem.

avatar image JaredHD AlexPan4 · Feb 17, 2017 at 07:01 PM 0
Share

Ok I've done a bit of playing around with the UI and I think I might know what's going on. The Scaler slider above the game is set to 0.93 because that's how the UI fits. When you build your game it will use the 0.93 for the UI but everything else will be rendered normally. $$anonymous$$G. The scene behind the UI will be 1. So there's no need to worry about the scaler above the Game View.

Just as a note: That Slider above the screen is just a zoom function. It's used if you want too see something in more detail but otherwise i would suggest it remains all the way to the left.

Check out this link. $$anonymous$$aybe it'll help more.

You might also notice the black edges of the screen where the Game isn't rendered due to the resolution. (The sides) That'll go also when the game is full screen and has been built.

Build you game and test if the resolution is right and if the UI is correctly rendered.

Show more comments
avatar image JaredHD · Feb 18, 2017 at 05:52 AM 0
Share

Try and set up the buttons again but using the 1024: 640 resolution. Then try and change to the resolution to a lower resolution ( maybe even higher resolution). If it remains working then I got no clue as to why it wasn't working. $$anonymous$$aybe your pivots weren't set right. Ensure that when you assigned the Anchors use shift and alt to assign pivots and set it to the position.

avatar image AlexPan4 JaredHD · Feb 18, 2017 at 11:05 AM 0
Share

Thanks for the suggestion but it didn't work. I have worked quite a bit with Unity's UI so checking if the anchors are correct was one of the first things I did. Also check at the Update I did if it helps you understand what is happening.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Oana · Feb 18, 2017 at 07:08 AM

It sounds like in the 1024x640 version it doesn't fully fit into your game view, so it gets scaled down, and if you scale it up to 1, then parts of it will be off the game view window.

Could you try pressing "maximize on play" to confirm that it does look ok at a scale of 1? If my suspicion is correct, then it's working as expected and it will look fine on your device.

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 AlexPan4 · Feb 18, 2017 at 10:52 AM 0
Share

I have ran the game with the "maximized on play" pressed and also built the game. The problem persists in both cases. There is an Update in my initial post if it helps. Thanks

avatar image JaredHD AlexPan4 · Feb 18, 2017 at 11:03 AM 0
Share

Have you tried setting the Pivots when setting the anchors?

avatar image AlexPan4 JaredHD · Feb 18, 2017 at 11:18 AM 0
Share

You mean shift click? Yes

avatar image
0

Answer by Cipher123 · Jun 21, 2018 at 06:09 AM

follow this link will solve your problem https://docs.unity3d.com/Manual/HOWTO-UIMultiResolution.html

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Fit application to any device resolution 1 Answer

Best way to move elements around screen [uGUI] 0 Answers

UI Texture Max Size (inspector) 1 Answer

Background and UI scalings are wrong 1 Answer

Unity Scene View has other Resolution then Game View. 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