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 diggerjohn · Dec 09, 2014 at 06:30 PM · buildresolutionscreen

Game window vs Application resolution

When I play my application in the editor all the elements are the correct proportions. When I build and play the app everything is stretched length wise and squashed height wise.

This is driving me crazy. My app needs to display at 1024x768 full screen for user. What in the world am I missing?

I have been looking at different threads and I guess I just don't get it. Any help is welcome.

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 diggerjohn · Dec 09, 2014 at 06:47 PM 0
Share

I should add I am doing a Standalone build for PC.

avatar image PhoenixBlackReal · Dec 09, 2014 at 07:38 PM 0
Share

Fullscreen stretches your game view to fill the screen and be of the physical screen aspect ratio. To still have a 1024x768 aspect ratio, you could somewhat use this: http://gamedesigntheory.blogspot.com/2010/09/controlling-aspect-ratio-in-unity.html

1 Reply

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

Answer by Merman · Dec 09, 2014 at 08:49 PM

Try

Screen.SetResolution(1024, 768 , true);

wherever you are telling the game to run in full screen mode. If you are doing this from the Player Settings, simply set the default screen width and default screen height and select the "Default is Full Screen" option.

If the monitor running the game does not support 1024 x 768 for some reason, though, the game will attempt to fall back to the closest available setting (as far as I know). It would be better to generate a list of available resolutions and allow the player to choose the one they'd prefer.

Also, on your canvas (assuming you're using the new UI system), change the UI scale mode to "scale with screen size". Set the reference resolution, and set screen match mode to "width or height" with the slider at 0.5. This should minimize any distortion regardless of the resolution chosen.

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 diggerjohn · Dec 09, 2014 at 08:58 PM 0
Share

Thank you. As it turns out the solution was a combination of factors. What you offered was one. Another was in the player settings. Default Screen width and height. Also my camera near, far, width and height needed adjusting. In the end I have learned a lot about setting up for a build. Thanks again for the response.

avatar image Merman · Dec 09, 2014 at 09:01 PM 0
Share

No problem. Glad to have been of assistance.

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

27 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

Related Questions

Build Resolution differs to editor resolution 0 Answers

Is there an alternate way to Build? 2 Answers

How to lock aspect ratio on full screen 4 Answers

Distribute terrain in zones 3 Answers

how to get a window bigger than screen 0 Answers


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