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
2
Question by furibaito · Mar 11, 2015 at 03:51 PM · androiduibuildresolutionscreen

UI and resolution problems (fine in editor, problem in Android build)

Hello, currently the UI elements in my game is responsive to the screen resolution in the Unity Editor game view. I even tried with many resolutions and Free Aspect view in Unity to test my UI and gives perfect results.

However, after I built the game for Android as APK and installing it in my tablet, the UI seems to be broken, UI elements that I had anchored to the corner doesn't work, some appear offscreen and what should be offscreen became on screen.

I tried changing the build setting to windows and build the game. After I tested it, same problems with the android version.

The UI works perfectly on the editor however, what could be the problem here? Thank you commUnity.

Comment
Add comment · Show 5
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 jtok4j · Apr 01, 2015 at 09:35 AM 0
Share

I am also searching for this exact issue's solution. Have not seen this before in my previous 2 commercial projects built with Unity... Like you, the GUI looks fabulous in the Editor, even at the same resolutions as the Android devices, but after building the AP$$anonymous$$, it's quite unuseable... stretched images, elements not aligned anymore, etc.

avatar image DoTA_KAMIKADzE · Apr 01, 2015 at 10:45 AM 0
Share

Try this settings in CanvasScaler component of your UI canvas:

UI Scale $$anonymous$$ode => Scale with screen size

Set reference resolution

Screen match mode => select the one you like more, "expand" should work for 100% cases if you set anchors properly.

avatar image furibaito · Apr 03, 2015 at 03:45 PM 0
Share

I already fixed this issue, using the hard way. I actually recreate all of the UI elements and it seems the problem is fixed. I think the scene file is corrupted or something that makes this problem happened (As all of my UI was not made as a prefab). Or maybe because of I'm using Ctrl-Z in editor while editing UI a lot. Somehow Ctrl-Z sometimes could make the UI broken in the editor. $$anonymous$$ostly with anchors which made the UI looks broken.

avatar image CarlGammaSagan · Aug 26, 2015 at 04:19 AM 0
Share

I've been having the same problem (stretched images, elements not aligned, GUI elements moving a lot between Editor and build version). I'm currently on Unity 5.1.1.

Has there been any fixes for this? It seems to be a pretty big deal because this prevents us from creating a usable GUI in any build (not just Android for me).

Ctrl-Z may cause this issue? But Ctrl-Z is so useful...

Is any of this documented elsewhere besides this question (which surprisingly doesn't have a lot of people following/commenting).

avatar image CarlGammaSagan · Aug 27, 2015 at 09:39 PM 0
Share

Did anyone also see a message like this in the logs of the build version?:

"The file 'pathtofile/level5' is corrupted! Remove it and launch unity again! [Position out of bounds!]"

There are a lot of threads that indicate this may be caused by a .js and .cs file having the same name. However, I have no .js scripts in my entire project. Is there another reason for this error message in the logs of the build version?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by jtok4j · Apr 03, 2015 at 04:13 PM

Hmm, Depending on the editor's version (e.g. 4.6 or newer) you may find that your "guitexture"'s actual texture files in the editor has been assigned (automatically) the Texture type of : Sprite...

This caused my project to look great within the GUI of the editor, and then look very strange/messed up with different texture sizes/text coordinates on the screen of the device (android).

So, I changed the "Texture Type" To: Legacy GUI (Sorry, it's a bit longer than that, but I can't remember the whole title.)

Then... surprisingly the textures started showing (within the editor) as they did (messed up) within the actual android build... So, I can now change them to the right size/screen placement and they match (in the editor) what's shown in the actual android build.

Hope this helps anyone who was disappointed/pulling their hair out like I was. (Note: These instructions were for using the "old" Unity GUI system in the 4.6 version of Unity Editor)

Comment
Add comment · Show 1 · 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 CarlGammaSagan · Aug 26, 2015 at 09:32 PM 0
Share

I'm having the same issues you did but with Unity Editor 5.1.1

Could not find anything similar to "Texture Type" in this version.

Is there a similar fix for version 5.1.1?

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

6 People are following this question.

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

Related Questions

Use different sprites in new Unity UI for SD vs HD 2 Answers

Game window vs Application resolution 1 Answer

How can I support FHD+ Resolution in Android game? 0 Answers

Finding Screen Resolution of an Android Device 0 Answers

Divide resolution and stretch to screen/window/canvas 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