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 Aldo Filippini · Nov 04, 2010 at 05:04 PM · windowmaximize

Windows maximized

Is it possible to start an app (standalone PC Unity app) with a maximized window? The default resolution I put int the player is not exactly what I'm looking for: a window that expands in the whole available desktop working area (1 monitor) without interfering with the windows task bar.

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 cregox · Dec 08, 2011 at 07:16 PM 0
Share

also unanswered: http://answers.unity3d.com/questions/27490/$$anonymous$$imizing-and-maximizing-by-script.html

avatar image Bunny83 · Jun 12, 2012 at 10:54 AM 1
Share

"the whole available desktop working area" usually refers to the whole desktop, but what do you mean by "1 monitor"? Do you mean you have two monitors but want to display it on just one, or do you mean you only have one monitor at all? If you have two monitors, the whole desktop will cover both monitors and not just one.

3 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by keld-oelykke · Jun 12, 2012 at 10:38 AM

If you want to maximize your standalone unity app running in Window Mode, you can do so by using Screen.currentResolution to get the current desktop resolution.

You can then use SetResolution with the desktop resolution, BUT you need to reduce the arguments width and height to give room for the Window borders.

My guess is that SetResolution was designed for fullscreen and it doesn't really do the job for when you need to change the Window size in Window Mode. SetResolution changes the client area e.g. rendered viewport within the Window. It seems that if SetResolution results in a window greater than the desktop resolution then Unity shrinks the window.

The workaround is to take your desired window size and subtract it with the current window border size.

In C# you can use the native method calls GetWindowRect and GetClientRect to calculate the border sizes.

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 Bunny83 · Jun 12, 2012 at 10:50 AM 3
Share

Just want to add that GetWindowRect and GetClientRect is not part of .NET / $$anonymous$$ono. It's a native code function (in the User32.dll) of windows. If you are on $$anonymous$$ac or any other platform you need to find something equivalent.

Btw. You can use those function in any language in Unity. Both UnityScript and C# are compiled to CIL. There are some language features (like properties, interfaces) that can only be defined in C#, but external functions / interfaces can be used by all languages.

I still prefer C# ;)

avatar image keld-oelykke · Jun 12, 2012 at 11:21 AM 0
Share

Good point Bunny!

avatar image
1

Answer by green_core · Dec 08, 2011 at 08:18 PM

It looks like fullscreen mode. To run unity in window mode you can change player settings in Edit->Project Settings->Player and set "Default Is Full Screen" property to false. Also you can change it programmatically by using Screen class.

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 mabakay · Jul 17, 2017 at 07:19 AM 0
Share

"$$anonymous$$aximized window" is not the same as "Fullscreen".

avatar image
0

Answer by kevin-masson · Jul 31, 2020 at 01:30 PM

It is possible, but not natively with Unity.

Here is a script that maximize your game window on startup. It only works on Windows and you just need to place the script in your project. You need to replace "APP_NAME" by a regex that matches your Application.productName.

Use these settings for your player settings: alt text

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

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

Minimizing and maximizing by script 3 Answers

Keeping MonoDevelop from going fullscreen when opening a file 0 Answers

Maximize Editor Game Window on Mac 1 Answer

Customize Game Window (For Exported Project) 1 Answer

Maximizing Unity Freeze 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