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
1
Question by felixpk · Oct 28, 2014 at 05:12 PM · guiiosunity 4.6orientationbest-practices

Adjust UI, On Device Orientation Change

Hello again!

I think the title is fairly clear and you know what I want to achieve. I just want to know if there is simple way, or some kind of "best practice"?

By the way I am using the 4.6 Beta (new GUI).

Thank you in advance!

Comment
Add comment · Show 2
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 AlwaysSunny · Oct 29, 2014 at 06:07 AM 0
Share

Head's up, the new GUI system is called UI to distinguish it from its predecessor.

Interesting question, though. I would think in most situations you could merely stretch and / or rotate the canvas, and the anchoring system would compensate for having been stretched / turned. If you can't do it to the canvas itself, then insert a parent object (child of canvas, parent of canvas elements) and alter that ins$$anonymous$$d.

avatar image iwaldrop · Oct 29, 2014 at 07:58 AM 0
Share

I've found that, typically, ux differs between portrait and landscape so drastically that you might as well use two discrete canvases which are switched on and off depending on which orientation you are in. This doesn't necessarily apply to the simplest of cases where you might be able to get away with simply rotating the canvas. As @AlwaysSunny suggests, the Anchoring system should accommodate it, and provided you've setup your RectTransforms correctly then it should appear serviceable.

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by vakanderson · Feb 20, 2015 at 06:17 PM

The anchoring system handles most situations like the other posters noted, however some interfaces can/should be laid out quite differently for various orientations. For those cases, once you know the orientation has changed, you can use the animation system or custom scripting to re-arrange the elements on screen. Here's how to detect the change:

http://docs.unity3d.com/Manual/MobileAdvanced.html

"You can retrieve device orientation by accessing the Screen.orientation property."

actually http://docs.unity3d.com/460/Documentation/Manual/MobileAdvanced.html

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

29 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Lock splash screen to portrait on iPad 0 Answers

Unity IOS xcode gives 64 bit support error 0 Answers

Issue with GUI.TextArea keyboard on iPhone 0 Answers

App starts in Portrait mode on iPhone 1 Answer

Unity 4.6 ui scroll rect won't show up in fullscreen 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