Handling iPhone 5/ iPad / iPhone 3

I just got an iPhone 5 and ran my Unity app on it, the buttons are really tiny! I don’t have an iPad but would assume the buttons would be huge.

Is there a guide on how you handle different devices (and for that matter Android as well) within one app ?

How do you handle different devices in your apps ? Do you have code which detects the device and performs code ? How do you detect the device type ?

What about textures, do they have to be greater resolution(HD) for iphone 5 /ipad ?

Any advice appreciated

Thanks.

What GUI system are you using, the built-in of Unity perhaps? All depends on that. I recently did a project that from same codebase published to web (640x400), and three iOS resolutions (480x360, 960x640, 1136x640 and 1024x768). I just checked the Screen.width property to determine on what screen size the app is running, and with that knowledge resized (and sometimes repositioned) the GUI accordingly.

I didn’t use UnityGUI for other than displaying text (besides debug-buttons), and there I fixed the text size buy using different GUIStyles. With 4.0 you can change the font size dynamically in mobile too, which is nice. For most parts of the GUI I used NGUI. There I just resized NGUI’s UIAnchors (anchor points of NGUI-elements), which took care of resizing the parent elements.

As for textures, we went with one set of them. For oldest iPads it has some trouble with memory, most times runs fine. For this decision, support for retina iPad resolution was dropped (downscaling to 1024x768 instead), that would have required bigger textures and the NGUI-elements couldn’t have resized any bigger without recreating the bitmaps too.

If you’re using UnityGUI for buttons, then they indeed are quite small on hi-dpi devices, since their size are fixed to certain pixel dimensions. For those, you most likely have to resize them with GUISkins.

Yes I’m using the Unity GUI. Thanks for your reply. It seems a little less complicated than i was expecting.