Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: bagomints on September 08, 2015, 11:29:01 AM

Title: Setting resolution at runtime makes sprites disappear
Post by: bagomints on September 08, 2015, 11:29:01 AM
I'm running the new Unity 5.2 released today, NGUI version 3.9.2.

In the editor, my UI appears fine, even on resolution changes with the anchors properly displacing things. But that's because setting the resolution at runtime through a UI popup list and through code while in the Editor doesn't do anything.

However, when I build and run the game, where this option does change the game resolution and windowed/fullscreen mode, the UI disappears until I resize the game window manually by dragging the window frame with my mouse. (In my code, I set the screen resolution and windowed/fullscreen at runtime when the game opens using saved user settings, as well as allowing it to be set through the UI where the user can choose windowed mode and a resolution which then applies it immediately).

I think it has to do with setting the screen resolution at runtime, because it's actually not displacing the UI and scaling it properly until I manually resize the window.

Do I have to do something special in NGUI to refresh the UI when I change resolution or windowed mode?
Title: Re: Setting resolution at runtime makes sprites disappear
Post by: Holy Manfred on September 08, 2015, 05:27:00 PM
It might have something to do with 5.2. I have a similar situation (resolution change menu in standalone build). Until yesterday my resolution change menu worked fine but after the upgrade to 5.2 I started having problems similar to the ones you described.
Title: Re: Setting resolution at runtime makes sprites disappear
Post by: bagomints on September 08, 2015, 09:58:01 PM
Ah okay.

So your standalone build in 5.1 was working fine, and then upgrading it caused a similar problem? I don't remember testing a standalone build in 5.1 so I just want to make sure.
Title: Re: Setting resolution at runtime makes sprites disappear
Post by: Holy Manfred on September 09, 2015, 12:45:04 PM
I think so at least. I was on 5.1.2 and never encountered this problem.
I haven't done any extensive testing though, but I saw a couple of threads over at reddit and the Unity forum where people have the same issues. Looks like SetResolution() is on the fritz for now.

Edit: I think this is the one: http://issuetracker.unity3d.com/issues/dx11-full-screen-with-low-resolutions-renders-incorrectly (http://issuetracker.unity3d.com/issues/dx11-full-screen-with-low-resolutions-renders-incorrectly)