Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: vallcrist on March 09, 2014, 01:43:39 AM

Title: NGUI Breaking on game window resize
Post by: vallcrist on March 09, 2014, 01:43:39 AM
Hello again everyone. =)

I'm having a little problem with NGUI since 3.4~

It seems like the world-coordinates height of a dynamic label is calculated when it changes ( appears / changes text ).

Our game is a facebook game that uses the FacebookSDK, on the SDK, whenever we make a request to facebook, the game screen is "hidden", it goes really really small, after the request is completed, the game goes back to the previous resolution.

The problem is, if any label shows up in response to the request, and after the game goes back to normal resolution, she appears ridiculous large, i'll attach 2 screenshots showing it.

Intended : http://ctrlv.in/303516
Actual : http://ctrlv.in/303517

You can replicate it by:

Adding a dynamic label to a scene and deactivate it
Run the project
Set the game window to 10x10 using the resolution picker
Activate the label
Set the game window to 16:9 resolution

Any ideas how can I fix this?
Title: Re: NGUI Breaking on game window resize
Post by: ArenMook on March 09, 2014, 09:35:58 AM
If you want to hide the UI, you can simply set the root UIPanel's alpha to 0, or better yet -- disable the camera that draws the UI.
Title: Re: NGUI Breaking on game window resize
Post by: vallcrist on March 09, 2014, 12:14:21 PM
The problem is not hiding the UI, it's the UI misbehaving on very small resolutions ( like the 10x10 that the facebook sdk sets the resolution when it's handling requests )
Title: Re: NGUI Breaking on game window resize
Post by: ArenMook on March 10, 2014, 08:48:19 PM
Set UIRoot to use fixed size using the target resolution of your choice, and make sure your labels don't have the "keep crisp" option enabled, as it depends on the screen resolution.
Title: Re: NGUI Breaking on game window resize
Post by: vallcrist on March 11, 2014, 10:11:19 AM
Ok.. Keep crisp was the problem. Thanks aren