Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Benjamin Schulz · Mar 16, 2011 at 04:14 PM · rotationguiiosiphoneipad

rotated GUI behaving differently on iphone and ipad

Hello,

i am rotating my GUI via

if ((Input.deviceOrientation == DeviceOrientation.LandscapeLeft) && (Screen.orientation != ScreenOrientation.LandscapeLeft)) { Screen.orientation = ScreenOrientation.LandscapeLeft; }

 if ((Input.deviceOrientation == DeviceOrientation.LandscapeRight) 
         && (Screen.orientation != ScreenOrientation.LandscapeRight))
 { 
     Screen.orientation = ScreenOrientation.LandscapeRight;
 }

in the update of a component attached to a GameObject.

I've also set

iPhoneKeyboard.autorotateToPortrait = false;
iPhoneKeyboard.autorotateToPortraitUpsideDown = false;
iPhoneKeyboard.autorotateToLandscapeLeft = true;
iPhoneKeyboard.autorotateToLandscapeRight = true;

in the Start of that behaviour.

I also have other components that do have OnGUI-methods.

One in particular is behaving strange on the iphone (3g iOS 4.0/4g iOS 4.1) but NOT on the iPad (iOS 4.2.1 and another one with iOS 3.2). What happens is the following: The Visualisation of the GUI is rotated as expected but not the input, which means, that i do have do click on the old positions of the Buttons to click them.

Also the touches i get from Input.touches are still rotated "the old way" which means it is always you'd expect to get them when you'd never set the Screen.orientaion to anything.

What puzzles me is the following: It is behaving differently on different devices. There's nothing special about the broken component's OnGUI - i've reduced it to one button. The only thing i can say about it is, that it is the ingame-gui and that's the place where we're having the worst FPS (20-30). And why on earth is the visualisation rotated but the input is not?

All that makes be suspect, that either there is a Bug in Unity or the execution-order of the Update, OnGUI is somehow messed on the different platforms.

Did anyone observer similar behaviour? Is this a bug? How do i fix or work-around it?

best regards

-- Benjamin Schulz

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Mantas-Puida · Apr 09, 2011 at 08:41 PM 0
Share

If can make simple repro of one-two scripts, please report a bug. Thanks!

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Benjamin Schulz · Apr 11, 2011 at 02:40 PM

Ok, found it: don't use Screen.SetResolution(1024, 768, Screen.fullScreen); on the ipad/iphone, that was what caused it.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

How to drag a scrollView with TouchPhase.Moved? 0 Answers

iphone like date pickers 1 Answer

strange phenomenon after build and run 1 Answer

apple rejected app due to iphone & iPad resolution mismatch 1 Answer

How to identify each iOS device? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges