- Home /
Flipped resolution ?!
Hi, Recently i upgraded to unity 3.5 and xCode 4.2 snow leopard(still). When i use the Screen.width and Screen.height in unity the result are flipped when running on ipad or iphone. I set the app to run landscape Right. the print(Screen.width) is flipped means i get 320 in unity and 480 while running. Any solution for this?? TY:)
Answer by whydoidoit · Jul 01, 2012 at 10:16 PM
Yeah there is a known fault and some potential workarounds in the linked thread.
Hi, ive got this code from googling - where should i put it? it it c##? or javascript? i get errors either way so i dont know how to use it. Please help.
IEnumerator Start ()
{
// HAC$$anonymous$$ to prevent game starting in portrait due to Unity bug
switch (Input.deviceOrientation) {
case DeviceOrientation.FaceDown:
case DeviceOrientation.FaceUp:
case DeviceOrientation.Portrait:
case DeviceOrientation.PortraitUpsideDown:
// None landscape orientation, set it manually
Screen.orientation = ScreenOrientation.LandscapeLeft;
// Wait a bit
yield return new WaitForSeconds(0.5f);
// Set back to autorotation, it should be alright by now
Screen.orientation = ScreenOrientation.AutoRotation;
break;
}
yield return null;
}
Well that is C# - put it in a .cs script and attach it to something that is in the first scene.
Ty very much for all help! i maybe solve this soon, the good news is that i found and manage to use this code here - which i applied and successfully made it work. The app is loading with the right orientation, BUT now the weird thing is that this is sometime work and sometimes not! still working on it....
Answer by amit-chai · Jul 02, 2012 at 07:15 PM
Ty very much for all help! i maybe solve this soon, the good news is that i found and manage to use this code here - which i applied and successfully made it work. The app is loading with the right orientation, BUT now the weird thing is that this is sometime work and sometimes not! still working on it....
Answer by amit-chai · Jul 02, 2012 at 09:32 PM
pweeks
TYYYYY : solution works Location Nederland, CO Posts 75 Posted: 07:58 PM 05-24-2012 Originally Posted by Alexey
http://files.unity3d.com/alexey/AppController.mm it is drop-in replacement for 3.5.2 appcontroller
replacement appcontroller.mm did not work
Your answer
Follow this Question
Related Questions
Input.acceleration with Screen.width 1 Answer
Object resolution 0 Answers
behavior of Screen object differs in Unity 3 1 Answer
Screen.width and Screen.currentResolution returning unwanted value 0 Answers
GameObject width in screen space 1 Answer