x


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?

more ▼

asked Apr 27, 2011 at 06:52 AM

Irsan gravatar image

Irsan
75 102 85 92

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

<= 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...

more ▼

answered Apr 27, 2011 at 07:06 AM

loopyllama gravatar image

loopyllama
1.5k 1 5 22

(comments are locked)
10|3000 characters needed characters left

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. ;)

more ▼

answered Apr 27, 2011 at 07:06 AM

CHPedersen gravatar image

CHPedersen
11.6k 42 49 102

... Why was I downvoted for that?

Apr 28, 2011 at 06:28 AM CHPedersen
(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Apr 27, 2011 at 07:10 AM

Ashkan_gc gravatar image

Ashkan_gc
10k 76 91 160

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2182
x150
x53

asked: Apr 27, 2011 at 06:52 AM

Seen: 41861 times

Last Updated: Apr 27, 2011 at 06:52 AM