0
\$\begingroup\$

This game is built using Unity 4, C#, and the 2D toolkit. In the unity game scene settings, it is set to (ios 5 tall) and I matched the Menu background dimensions with the dimensions of an ios 5 tall device. When testing this build on a different ios device(ios 4 etc...), the menu background doesn't fit (stretch) to the width and height of the tested device's dimensions. The answer seems pretty obvious that i'm not handling all devices dimensions.

What would be a good approach on handling images based on different ios devices? Are there any build settings to build a project that handles each device dimensions?

Thanks in advance for any advice or a good approach for cross-device handling

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

to figure out which device the app is running on have a look at:

http://docs.unity3d.com/ScriptReference/iPhone-generation.html function http://docs.unity3d.com/ScriptReference/iPhoneGeneration.html enumeration list

example here: http://forum.unity3d.com/threads/iphone-generation.32742/

\$\endgroup\$
3
  • \$\begingroup\$ Awesome. This is half of what I was looking for! So let's say i'm using a background gui sprite that is going to switch images based on the device. Would I then write this script similar to above and then attach it to the background gui? Is this common for handling cross devices? This way i'm going to have to attach this script to every sprite. Will this cause issues? Or is there a more efficient way to load all images with one script instead of tons. \$\endgroup\$
    – Kamakazi
    Commented Dec 30, 2014 at 16:21
  • \$\begingroup\$ had a bit of a google and I think these might be of interest: gamedev.stackexchange.com/questions/79546/… stackoverflow.com/questions/21369067/… unfortunately it looks like a "it depends" question. \$\endgroup\$
    – Lefty
    Commented Dec 31, 2014 at 9:02
  • \$\begingroup\$ Thank you. I also found similar answers and it definitely depends on the goal at hand. The first links were what I was looking for to get started. Thanks! \$\endgroup\$
    – Kamakazi
    Commented Dec 31, 2014 at 9:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .