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 mirecek · Mar 02, 2011 at 09:14 AM · resolutionsettingsfullscreen

Standalone application fullscreen

We solve some specific trouble with fullscreen. Our request is to lunch application to fullscreen at current system resolution. For exammple my HP has 1920x1200px maximum native resolution and ma fujitsu has 1680x1050. It possible detect actual screen resolution and set it to fullscreen for each computers?

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

3 Replies

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

Answer by taoa · Mar 02, 2011 at 09:50 AM

Not directly with Unity's API. You could use an external library for that that will tell you current desktop's resolution, but you'd have to find it on your particular platform which might prove difficult (and definitely annoying). Plus you'd have to find a specific solution for each platform you're targeting (for instance, a solution specific for Windows, and another one for OSX).

However Unity can give you a list of all the resolutions supported by the user's monitor screen:

Resolution[] Screen.resolutions

This array contains all those resolutions. If you pick the last one in the array, it's the largest resolution supported, and is often the native resolution of the screen. So it's your best bet.

There are two things you should be careful about with this though. One is not so bad, the other one much much worse:

1) The highest value might not be the monitor's native resolution, some monitors accept higher resolution (mine for instance is a native 1680*1050 but accepts and displays up to 1920*1200), and the array will reflect that.

2) Even if a value is in the array of resolutions, and even if Unity promises that the resolutions returned in this array are all supported by the monitor, well, I'm afraid this is unreliable. We had users who would pick an unsupported resolution and ending up being stuck with a black screen. So make sure you add some sort of timer after picking a new resolution where the user must agree to it, turning back to the previous working resolution if he doesn't.

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 mirecek · Mar 03, 2011 at 06:18 AM 0
Share

Please, have you more information about external library for $$anonymous$$ac and Windows? Thanks for advice

avatar image taoa · Mar 03, 2011 at 10:19 AM 1
Share

Sorry, no. Google is your friend.

avatar image
3

Answer by wemotom · Jan 23, 2012 at 10:18 PM

Our title also urgently needs this functionality, and it is baffling that this is not an option in the Player Settings -> Resolution and Presentation dialog. I'm using 3.4.2 pro and have not looked at the 3.5 beta to see if things are better there.

The good news is that I have found a workaround for PC:

Go into the Player Settings -> Resolution Presentation and set the "Default Screen Width/Height" to obscenely large number (I'm using 32000).

Then when launched, standalone app apparently will realize it is unable able to achieve this resolution, and will just keep the resolution untouched - which is exactly what we want, and will still go fullscreen.

Unfortunately the logic seems completely different for the mac and doesn't work there. Doing the same thing on the mac causes it to jump to the highest available resolution, which is not desired. On both platforms, setting it to small values (including 0 and negative values), causes the resolution to be hard set to 640x480.

A few more notes: on the PC the values seem to be stored in the registry under

 HKEY_CURRENT_USER->Software->Title->ScreenManager Resolution

but note that these values appear to be stomped on every launch by the values hard coded in the Player Settings so I don't think they are relevant. On the mac, the same settings are stored in ~/Library/Preferences/unity.Title.plist - but these are not stomped and instead are used on each subsequent launch.

We are going to continue to try to find workarounds for the mac. If anyone else has solutions for this issue, we'd love to hear it!

Comment
Add comment · Show 3 · 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 kevinseligmann · Mar 12, 2012 at 07:15 PM 0
Share

You literally saved my life with the number 32.000. Thanks!

avatar image by0log1c · Mar 12, 2012 at 07:31 PM 0
Share

@kevinseligmann is someone holding you at gunpoint for a fullscreen resolution? :p

avatar image kevinseligmann · Mar 12, 2012 at 08:59 PM 0
Share

@BY0LOG1C $$anonymous$$ind of hahaha. Let's say that without that number, my presentation today wouldn't have been possible, and who know what would have happened...

avatar image
1

Answer by Corscaria · Dec 01, 2012 at 03:25 AM

You can achieve the functionality you need with Unity's API, by starting the application in windowed mode and using Screen.currentResolution to fetch the desktop resolution. Then switch to fullscreen mode at the resolution of the desktop.

example:

 void Awake()
 {
     Resolution res = Screen.currentResolution;
     Screen.SetResolution(res.width, res.height, true, res.refreshRate);
 }


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 3yanlis1bos · Mar 15, 2013 at 03:12 PM 0
Share

Are you sure? Because i just tried the same in my pc and it gave me the second lowest resolution that is supported by my monitor.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

In Game Graphics/Resolution Options 2 Answers

Can I change Terrain resolution when zooming out 2 Answers

Screen.SetResolution doesn't work when the game starts windowed? 0 Answers

full screen and resolution 1 Answer

Comodo Firewall hangs Unity in fullscreen standalone mode 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