"iPhone 5 Tall resolution" settings seem to be clipping graphics in the Unity Editor

Hello.

I am not sure if anyone else is having issues with this but basically I have been designing my current game with the iPhone 4 aspect ratio but if I switch to the “iPhone 5 Tall” screen resolution in the Unity editor, it clips the sides so what use to fit pretty well before now is cut off on both sides.

While I do use Prime31s UIToolkit. The problem is the default Unity GUITexture and GUIText I am using becomes enlarged when using “iPhone 5 Tall”. It’s as if Unity just pulls the camera back and just chops off the sides to accommodate for the iPhone 5 resolution.

Previously, I have been working with the iPhone 4G Tall (640x960) resolution settings. Do I bite the bullet and customise the graphics for both resolutions or is there some magic trick I don’t know about? :face_with_spiral_eyes:

Any help or advice would be greatly appreciated. :wink:

I don’t know what’s the real issue here, but do take into account the fact that iPhone5 screen has different aspect ratio than iPhone4, so you might have to adapt FOV of the camera accordingly. Also, the iPhone5 resolution setting in editor is not pixel exact, as it is with iPhone4. You cannot therefore know what the pixel dimensions of the editor window is, if you’re not checking it via script or something.

So before you start adapting your code to work with iPhone5, make sure you’re running in the exact pixel dimensions. When I had to tweak my game to work with iPhone5, I temporarly switched the platform to Flash, set the 1136x640 fixed resolution there, slammed the UI-code in place and switched back to iOS. I know, the time it takes to reimport textures in iOS sucks, but one might hack around that by backuping the project folder etc.

just use 16:9 rather than actual resolution if you can, it should work fine. 9:16 is also supported afaik in 4

It’s a unity3d aspect ratio problem. I have the same thing with my app. When i look in the editors game view i don’t see all my buttons on the screen or at the correct position. But when i build in to an iPhone 5 it shows all my buttons and at the correct position. I mailed to unity3d support and they said they were going to fix it in the future.

Thanks for the replies everyone.

Yeah, if I had an iPhone 5 device, I could test it but as of now I cannot be sure how things fit on an actual device. It’s good to know it’s a known issue.

What is basically going on is that the editor is basically just rescaling the camera in both vertical and horizontal dimensions to meet the new iphone5 vertical height, then it clips the extraneous horizontal dimensions to conform. This is why GUI textures and GUI texts that were a fixed sized are getting scaled up. :frowning:

I hope they fix it soon. :wink:

I doubt there will be a fix as it isn’t broken. That is just the way it works. You need to change your camera settings when detecting the screen ratio.

What I wish Unity would fix is adding the 1136x640 screen size as an option in the Game window, just like they do for all other screen sizes. Unity have broken consistency with a few recent additions, this is the most annoying (calling the new icon size High-Res instead of the consistent 144x144 is another. How many devs have had to check they are not referring to the new 1024x1024 large size?).

Like i said i made a bug report to Unity support about this problem and they said they were going to fix is in the future because it is broken.

To clarify, a quick way to reproduce the issue I am seeing is:

  1. Set resolution to iPhone 4G tall.
  2. In an empty scene, create a GUI Text object and set the anchor to “upper center.”
  3. In the the text field for the GUI Text, type in enough characters so that it fits snug within the boundaries of the screen.
  4. Now set it to iPhone 5 Tall.

What I see in my editor is that the GUI Text gets clipped on both sides.

If anyone could confirm the steps above occurs only in the editor and not on an iPhone 5 device, please let me know.

GUI Text should not be clipped as it stays at the same pixel size. But I tried the following.

I have just done an editor test. When I change to iPhone 5 Tall, the GUI Text is clipped because my window is not 1136 pixels high, and it maintains the ratio, so the game image is less than 640 pixels wide.

If I undock my Game window, I can get it to more than 1136 pixels high, so the image is more than 640 pixels wide and there is a gap beyond the text.

I tried using a Print statement to read the screen size when I press play. I can never get it to read 1136 x 640 as I resize the window. One or the other is always off. And if I print screen and clip to the game image, it is always a couple of pixels off the size the Screen.width and Screen.height as displayed in the print statement.

I really really wish Unity would sort this and be consistent.