Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Zuecafajm · Feb 08, 2016 at 10:48 AM · uiresolutionstandalonescreen size

Screen Size Incorrect After Resizing on VNC

Hello,

We have a service that runs a VNC session through a browser. In this session we are running a Unity standalone application. When the browser is resized, the desktop resolution is changed to match the new size of the browser window. The Unity window is maximized so it automatically resizes as well. However, Unity reports the screen size (Screen.currentResolution.width/height) and window size (Screen.width/height) incorrectly after resizing. I have confirmed that windows is correctly detecting the change in screen size and is sending the correct messages to the window.


To get information for the issue I was getting reports on the size of the screen and the window from the following places:

  • Unity - Screen.currentResolution.width, Screen.currentResolution.height

  • Unity - Screen.width, Screen.height

  • Windows – GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)

  • Windows – GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN)

  • Windows – GetWindowRect


Windows correctly reports the size of the window and screen, and sends the WM_DISPLAYCHANGE message to the window. However, despite resizing with the screen, Unity reports that the screen size has remained the same. There are a few issues when the resolution is increased from the starting resolution. Unity seems to be enforcing a maximum size and caps Screen.SetResolution at what it believes to be the size of the screen. Despite this, the window can still be made larger than this limit by maximizing it. However, exceeding this size causes a couple of issues described below.

  • The UI gets stretched to fit the actual window dimension and becomes distorted & blurry

  • Interacting in the UI with the mouse does not work as expected. You need to click at the pixel offset of the button based on the size of the screen according to Unity. However, since the screen is not actually this size to click a button you need to click above and to the left of where the button is on screen.


If you can answer any of these questions it would be a great help with fixing the issue.

  • What is Unity using to determine when the resolution changes?

  • Is there a way we can force Unity to update the screen resolution.

  • Is there a way to force Unity to use a screen size larger than what it believes the screen resolution to be?

    • Screen.SetResolution is capped at the original resolution.

    Resizing the window in Windows causes the above symptoms.


Thank you for your help,

Aaron

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

2 Replies

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

Answer by danw_unity · Feb 25, 2016 at 11:39 PM

Hi,

Are you using the "Resizeable window" option in the Player Settings?

Aside from that, I find that resizing the desktop is a messy thing to do on Windows. I prefer the TeamViewer way of working, where the remote computer sees the desktop as it is on the host, but scaled to whatever window you view it in. Depends what you are trying to achieve of course.

Hope this helps,

Dan

Unity Support

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
avatar image
0

Answer by Zuecafajm · Feb 26, 2016 at 08:18 PM

Hello,

We do have the "Resizeable window" option checked, and the window is kept maximized so it automatically resizes with the desktop. Unfortunately we aren't able to use TeamViewer as a solution.

If you have any other things to try or could answer any of the questions from my original post I'd appreciate it.

Thank you, Aaron

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Letterboxing issues 0 Answers

Vector move based on screen size 0 Answers

Problem scalling UI Buttons Generated on Runtime 2 Answers

Text resizes depending on screen size? 1 Answer

Need help with orientation and screen sizes,Help with orientation and screen sizes 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