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 saruul34 · Apr 03, 2014 at 10:17 AM · androidlandscape

Android auto rotation problem

Hi all, I'm migrating iOS game to Android. Recently I have 2 problems.

  1. Player settings: Default orientation: Auto Rotation. Landscape right and left are checked. PROBLEM: Game starts portrait orientation and after splash image I can rotate my phone to get landscape mode. After that the game accepts only right and left landscapes as expected. I have a script that places the buttons according to screen width and height but it goes crazy because expected screen width gets height of the screen.

  2. Splash image doesn't show full screen.

Any help appreciated.

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 saruul34 · Apr 04, 2014 at 01:59 AM 1
Share
  1. I have tested with in the Android$$anonymous$$anifest.xml, but no luck.

  2. Splash image is 1024x768 and it works all iOS devices. Currently I'm testing on Samsung note N7000 with android 4.1.2.

avatar image saruul34 · Apr 08, 2014 at 04:33 AM 1
Share
  1. Landscape left or right only works as expected.

  2. Still have no solution

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by supernat · Apr 08, 2014 at 05:26 AM

The splash screen being full screen is dependent on the aspect ratio of the device and the setting you have in the Player Settings. If you choose Center for the Splash scaling, and the splash image doesn't match your device's aspect ratio, then you will get letterbox sides potentially. If you have it set to Scale to Fill, it should always be full screen. Also, 1024x768 isn't a native android resolution for every device, so it will only fit on some devices, but that's why Unity provides the Scale options in player settings for the splash image. Android does not have any concept of a splash image, whereas iOS builds that into the XCode project. It does some extra manipulation/scaling to make it fit on a very small number of devices but also allows you to select multiple image sizes for your splash, one for each device resolution. Unity creates its own version of the splash screen for Android by presenting it in the main View on startup.

When are you retrieving the Screen.width and Screen.height values? If in the Start method, then they will be wrong once your device rotates after this and you need to retrieve them again. I would like to help with your question, but I'm a bit confused since you say Landscape left or right only works as expected. You want them to not work as expected? What exactly is the issue, you can't return to portrait mode?

Comment
Add comment · Show 2 · 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
avatar image saruul34 · Apr 09, 2014 at 03:39 AM 0
Share

Ty for your answer. I designed my game for landscape mode. So I don't want to it in portrait mode. 1. If I choose multiple Landscape Left and Landscape Right in player settings, the game begins in portrait mode. After loaded fully, it keeps portrait and when I rotate device It goes to landscape mode and it locks landscape right and left as I set up in the player settings in Unity. But problem is screen.width and screen.height as you said, that makes everything in my game goes crazy. 2. If I choose Landscape left or Landscape right only. Game launches in landscape mode and it doesn't rotate (it should have), everything is in their places.

Once again thank your answer. I develop games for iOS. This is my first Android game and I haven't got any problems like that.

I have tested Scale to fill, but it crops the image. So we took your advice to prepare multiple splash images. But my designer gave new splash image that has borders faded away to black. (Edges of the image faded to black)

avatar image supernat · Apr 09, 2014 at 03:53 PM 0
Share

Hi saruul. I think I understand better. Are you running the latest version of Unity? Have you tried this on multiple devices? The thing about Android is, calling OS provided methods can return one thing on one device and behave completely different on another one, so this could be an issue that Unity needs to fix via work arounds. I will run a simple test on my Nexus 7 to see what it does with this.

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

21 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

Related Questions

Android Splash Screen starting in Portrait mode 1 Answer

Screen rotates despite playersettings set to: Landscape Left 1 Answer

Screen.width and Screen.height sometimes flipped for Android 1 Answer

DeviceOrientation not working fine 0 Answers

Android orientation issue 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