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
0
Question by Hannah_Corrie · Jan 27, 2020 at 10:22 AM · uimobileresolutionscreen size

Change UI size dependent on screen resolution

Hi!

So I am making a game for mobile and want it to be able to run on phones and ipads. I have read tutorials about scaling for resolution and for the phones it all looks great. However, when I switch to the ipad resolutions the buttons are all really big which is not quite what I want.

For example there is a row of four buttons that on the phones fill the bottom of the screen but when I switch to ipad they still fill the bottom of the screen making them huge. I am wondering if there is a solution for which they scale correctly for the phones but I can check if it is an ipad being used and if so have them smaller of show a different canvas with different sized UI.

I hope that made sense and thank you for your time!

Hannah

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 NVJOB · Jan 27, 2020 at 11:26 AM 2
Share

I recorded some "life hacks" for you that I use myself. $$anonymous$$y English is bad, so it was easier for me to show.

https://www.youtube.com/watch?v=I$$anonymous$$s-1Gtsn8A

Some clarifications on the video. I change the size by holding the Shift. Drag and drop the element holding Shift + CTRL.

avatar image Hannah_Corrie NVJOB · Jan 27, 2020 at 11:34 AM 0
Share

Thanks, I will take a look at this

avatar image NVJOB Hannah_Corrie · Jan 27, 2020 at 12:46 PM 1
Share

This is a short video and it just answers the question that you asked above.

avatar image Bonfire-Boy · Jan 27, 2020 at 01:21 PM 0
Share

I think the key insight you need here is that it's not just about screen resolution, it's also about physical screen size. You can work out the latter using Screen.dpi.


It sounds like you're going to want your buttons to scale differently on larger devices.

One way of handling this would be to create a script which allows you to define maximum and/or $$anonymous$$imum physical dimensions for a UI element and which, on Start(), clamps its size in pixels so that its physical size falls within those bounds. But how good this is going to end up looking and how complicated things are going to get will depend on how your UI hierarchy is set up (eg you might need to move things as well as adjusting their size).

Another way would be to set up 2 or more alternate UIs (or UI sections), and only have one of them active (choosing which one on Start(), depending on the physical screen size).

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Propagant · Jan 27, 2020 at 10:31 AM

Hello Hannah, did you try playing around with Canvas Scaler? There should be an option called UI Scale Mode - Scale With Screen Size. This should help you solve the UI scaling problem. Not sure if it does work for mobiles, but I hope it's similar...

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 Hannah_Corrie · Jan 27, 2020 at 11:30 AM 0
Share

Hello! Thanks for your quick response.

I am quite new to unity and specifically UI. So when I set up my canvas's with a reference resolution of 1080 x 1920 and with the resolutions set like that the phone resolutions look okay when I change them but when I select the 1800 x 2480 (ipad resolution) the icons are really big. But when I change the scale screen size to be 1800 x 2480 they look okay. But I have to manually change the reference resolution scaling. If I were to build the app they would stay to the 1080 x 1920 reference resolution layout right?

avatar image VirtuallyHealthy · May 31, 2020 at 03:09 PM 0
Share

Whenever I try to scale by screen size the images get really pixelated and you cannot read any of the words - any ideas on how to fix that please? And when I just use portrait 9:16 it cuts off the edges :(

avatar image Bonfire-Boy VirtuallyHealthy · May 31, 2020 at 05:53 PM 0
Share

That's quite a different thing to what this question is about, and quite specific. You'd be better off posting a new question. And add more detail about what you're doing. Are the words actually drawn into your images? How big are the images? Do they ever look ok? At what size? If the words are drawn into your images it could just be that the images are too small and you're scaling them up too far beyond their natural resolution.

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

247 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I anchor a child object? 1 Answer

Mobile Game Different Screen Size Issue 2 Answers

What is common screen resolution for android game to be selected 0 Answers

Use different sprites in new Unity UI for SD vs HD 2 Answers

New Unity Dropdown Menu to Change Game Resolution 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