Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resizable Window + Event System not resizing with window.

Discussion in 'UGUI & TextMesh Pro' started by Kevin-Ambruster, Feb 3, 2015.

  1. Kevin-Ambruster

    Kevin-Ambruster

    Joined:
    Jan 24, 2013
    Posts:
    4
    The issue I'm seeing has to do with a PC build NOT in the Editor. The Canvas properly re-sizes but it seems as though the EventSystem area does not resize. So all visible UI elements move to there proper positions based off of there anchors but the EventSystem does not seem to update.

    Using 4.6.1.f1 and 4.6.2.f1

    To reproduce.
    1. Add a canvas and EventSystem to a scene.
    2. The canvas has default settings. ie. "Screen Space - Overlay", etc...
    3. Place buttons on all four corners and anchor them to those corners.
    4. Make a build and allow for resizable window and DO NOT default to full screen.
    5. Run the app. If the app starts in a large resolution, drag the window to a smaller resolution. Close the window and restart the app.
    6. Now Resize the window to a larger resolution and try to click the buttons on the right side of the screen.

    It seems as though the resolution that the app starts in is the largest the EvenSystem will scale to. So if you start in 800x600 and resize the window to any larger resolution. You will only be able to interact with the 800x600 area in the upper left corner of the window.
     
  2. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    I'd file a bug report. The eventsystem knows nothing about the size of the screen, it just gets the mouse position then compares it to the elements.
     
  3. Kevin-Ambruster

    Kevin-Ambruster

    Joined:
    Jan 24, 2013
    Posts:
    4
    Thanks for the feedback. I just sent off a bug report with an example project.

    If it's not to much trouble keep me up to date please.
     
  4. Kevin-Ambruster

    Kevin-Ambruster

    Joined:
    Jan 24, 2013
    Posts:
    4
    This only occurs when making a build on a windows 7 machine. If making a build from a windows 8 machine the issue does not occur on windows 8 or windows 7.
     
    Last edited: Feb 4, 2015
  5. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    You should get reports back when the bug is resolved. Also the building on win 7 vs win 8 is a odd one...
     
  6. CorruptScanline

    CorruptScanline

    Joined:
    Mar 26, 2009
    Posts:
    217
    I am having this same issue in Unity 5 RC 3. OS is Windows 10 build 9926.
     
  7. Kevin-Ambruster

    Kevin-Ambruster

    Joined:
    Jan 24, 2013
    Posts:
    4
    Hey just a heads up found this thread
    http://forum.unity3d.com/threads/resizable-window-ui-elements-become-inactive-on-right-hand-edge.285871/#post-1888079

    This issue is corrected. I just did this call in the Update()

    Code (CSharp):
    1. void Update()
    2.     {
    3.         if (savedScreenRes.x != Screen.width || savedScreenRes.y != Screen.height)
    4.         {
    5.             Screen.SetResolution(Screen.width, Screen.height, false);
    6.             savedScreenRes.x = Screen.width;
    7.             savedScreenRes.y = Screen.height;
    8.         }
    9.     }
     
  8. iant123

    iant123

    Joined:
    Mar 28, 2015
    Posts:
    1
    Thanks Kevin,
    I had the same problem (unity 5.0.0, windows 8.1), and your fix worked for me.
    Do you have a link to the issue, so I can vote for it (so we don't need the workaround) ?
     
  9. bestknighter

    bestknighter

    Joined:
    Dec 2, 2014
    Posts:
    18
    I'm using Unity 5.0.1f1 and this bug still exists. And @Kevin Ambruster, sir, that workaround saved my life! Thanks!
     
    Kevin-Ambruster likes this.