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 cj_coimbra · Nov 08, 2011 at 11:44 PM · resolutionwindowdesktop

Current Desktop Resolution

Is there a way I can set Unity app resolution to the current desktop´s resolution during runtime (at startup) without using that input/resolution window?

Comment
Add comment
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

1 Reply

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

Answer by DaveA · Nov 08, 2011 at 11:55 PM

http://unity3d.com/support/documentation/ScriptReference/Screen-resolutions.html

http://unity3d.com/support/documentation/ScriptReference/Screen.SetResolution.html

Comment
Add comment · Show 8 · 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 cj_coimbra · Nov 09, 2011 at 12:06 AM 0
Share

Thanks, DaveA.

I am aware of Screen.resolutions and SetResolution. However I still can´t get the current desktop resolution with them.

The way I wanted, there would be no resolution dialogs. The game would startup using the PC current resolution. "Screen.resolutions" tells me the supported resolutions but not the one that is being used. I could just read it out and then set to the maximum resolution but that´s risky. In example, my monitor tells me it support 1600x1200 but it crashes when I set it... I guess I´ll have to stick with the resolution selection until I find something.

avatar image DaveA · Nov 09, 2011 at 12:10 AM 1
Share

http://unity3d.com/support/documentation/ScriptReference/Screen-currentResolution.html says it returns current resolution of the desktop

avatar image cj_coimbra · Nov 09, 2011 at 12:23 AM 0
Share

Well, then I´ll start it in windowed mode, catch the resolution and then set it to fullscreen in the correct resolution. Thanks!

avatar image jahroy · Nov 09, 2011 at 12:52 AM 0
Share

I could be wrong, but I think you need to be careful with Screen.currentResolution as well.

I believe it will return the maximum supported resolution for the current monitor. This means that you could experience issues if the user is not using the "recommended" resolution.

For example: if my monitor supports 1920x1200, but I have it set to something smaller, I believe Screen.currentResolution will still retrurn 1920x1200.

avatar image cj_coimbra · Nov 09, 2011 at 01:03 AM 1
Share

jahroy, that´s a valid point. To be sure, I´ve just tested it and it returns the resolution in use, not the maximum supported.

Show more comments

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

Is there a way to change the window resolution of a build without having the window snapping to the center of the screen in window mode? 0 Answers

Actual Desktop Resolution 1 Answer

resize standalone game window with mouse 2 Answers

How to set arbitrary window size when not in fullscreen? 0 Answers

Game window too small? 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