iOS development, screen sizes, and testing

Sorry, I’m not new to app development but am new to Unity.

I switched my target in Build Settings to iOS. I’ve also written code to handle the sizes and scales of my sprites for various devices sizes. Right now I’m just putting up my background image, which should completely and exactly fill the screen (pixel for pixel).

I’m running on an newish iMac that has a resolution of 2560x1440. Not retina (yet).

Because I didn’t see an iPhone 6+ resolution in the Game resolution pulldown, I added one that is 1080x1920. Problem is that my screen isn’t tall enough to show that. SO when I pull the Game tab out on it’s own the best it can do is 773x1375.

1924104--124257--Screen Shot 2015-01-17 at 1.09.19 AM.png 1924104--124258--Screen Shot 2015-01-17 at 1.02.14 AM.png

So in my app Screen.width and Screen.height report as the “using resolution”. Is there any way to fake it to scale the output at 50% like they do in the Xcode Simulator?

This way I guess I can just do everything for iPhone 6 and below. But what do I do about the tall retina iPad? Have to do every little bit of dev testing on the actual device?

Best thing is to buy an iPad and test it. I had the same problem. My monitors weren’t big enough to display Retina iPad, iPhone5/6 etc.

Make sure in your Unity build settings, under “Other Settings”, you set the following:

  • Target Device : iPhone + iPad
  • Target Resolution: Native (default device resolution)

I have iPads, iPhones, old and new… just about every model from history. I just don’t want to have to build to it for every little thing. I was hoping there was a way to have the display only show me every other pixel or something.

If you’re talking about UI sprites, and you’re using the new Unity UI system (from v4.6), then you can set a reference resolution (1920x1080) on your Canvas GameObject (the Canvas Scaler component specifically). Then, the UI system will layout your sprites based on that reference resolution and then scale everything up or down to your true resolution.

If you set your Canvas Scaler to handle different aspect ratios and such, then your canvas may not always be exactly 1920x1080. But you can just access the width and height values of the Canvas’ RectTransform instead of Screen.width and Screen.height. That will give you your reference width/height rather than actual screen width/height.

Hope that makes sense.