• 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 Irsan · Apr 27, 2011 at 06:52 AM · iphonehudaspect-ratio

Aspect ratio of the IPhone?

I need the aspect ratio of the iPhone so I can put a HUD in my game. Also, should I be weary if there are different versions with different aspect ratios? How do I tell my game to switch accordingly?

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

· Add your reply
  • Sort: 
avatar image
0

Answer by Ashkan_gc · Apr 27, 2011 at 07:10 AM

you can crate resolution independent guis.see this question.

but having different aspect ratios is different. you might need to design two guis for 4-3 and 16-9 ratios, images might need some tricks or be clamped. iphone res is 480-320 and ipad's res is 1024-768. iphone 4's resolution is different. you can set your unity's platform to iphone and then in top left corner of gameview you can set the resolution to all of those resolutions and see how your gui will looklike there. you ca download a trial from the website if you don't have unity iphone.

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

Answer by CHPedersen · Apr 27, 2011 at 07:06 AM

According to wikipedia's article, it's resolution is 640 x 960, which would indicate an aspect ratio of 4:6, right?

Since 4x160 = 640 and 6x160 = 960.

Edit: D'oh, 4:6 = 2:3. ;)

Comment
Add comment · Show 1 · 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 CHPedersen · Apr 28, 2011 at 06:28 AM 0
Share

... Why was I downvoted for that?

avatar image
0

Answer by loopyllama · Apr 27, 2011 at 07:06 AM

<= iphone3/itouch 3 is 480x320 || 320x480 so aspect ratio is 3:2 || 2:3

iphone4/itouch4 is 960x640 || 640x960 so aspect ratio is 3:2 || 2:3

ipad1/ipad2 is 1024x768 || 768x1024 so aspect ratio is 4:3 || 3:4

to tell which you have you can use Screen.width or Screen.currentResolution or iPhoneGeneration or iPhoneSettings.generation. I think the iPhoneGeneration is obsolete...

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

How Can I Get the Device Camera Aspect Ratio? 3 Answers

Unity iPhone - Player displays differently than on iPhone 1 Answer

Camera Viewport Rect Not Work in iPhone 5? 0 Answers

iphone screen size 2 Answers

How can I access the iPhone-specific aspect ratios? 3 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