Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 xCiter · Mar 10, 2015 at 06:33 PM · 2dmobileunity5resolution

Once more with the Aspect Ratio's

Hi all,

I've been googling the hell out of this for a few days now and have found mixed explanations on how to get it to work. Problem is, they all confuse the hell out of me. Some more so than others. So in a nutshell...

How does everyone deal with different screen resolutions for a 2D Game?

For example, I have a character that is 706x576 (Just a 2d character I found on the internet, I didn't make it)

What I want to know is, I've set the scale of the character to 0.3, 0.3, 0.3 as this is what looks best in the editor. How do I then scale that image for different mobile devices? Currently I'm only using my Samsung Galaxy S4 as a testing device for this game. The resolution of this mobile device is 1080 x 1920 if it helps people explain the answer to me xD

Thanks ~

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by AmazingDeveloper2 · Mar 10, 2015 at 07:38 PM

You can put all your object inside one parent object and change it's scale values.

 public GameObject scene; // parent GO
 Resolution[] resolutions;

 void Start() {
     resolutions = Screen.resolutions;
     foreach (Resolution res in resolutions)
         print(res.width + "x" + res.height);
     Screen.SetResolution(resolutions[0].width, resolutions[0].height, true);
     Screen.SetResolution (1366, 768, true);
 }

Value of the scale for each resolution you can calculate using proportion. For 1366*768 and lower:

 1366*768  -  1 // scale for x,y,z
 1360*768  -  0.99560761     
 1280*768  -  0.94117647
 1024*768  -  0.74963397
  800*600  -  0.58565154

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

23 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

Related Questions

Why the scalling between these 2 resolutions is so bad? 1 Answer

Game looks different on device compared to Game View 0 Answers

Proper resolution for pixelart mobile game 0 Answers

Best practices for large background image on mobile? 0 Answers

Resolution inconsistency on Huawei P20 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