Support => NGUI 3 Support => Topic started by: Agent_007 on May 12, 2014, 01:23:02 AM
Title: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: Agent_007 on May 12, 2014, 01:23:02 AM
I have soft clip scrollviews (B level, in image BLUE ones) inside of soft clip scrollview (A level, in image GREEN one) and there is one issue with clipping when I populate those B level scrollviews. A level scrollview doesn't clip those B level scrollviews unless I disable and enable A level scrollview after populating. (http://i.imgur.com/pSUI0Wd.jpg)
Problem with disable+enable is that on mobile devices that is too slow operation because there are so many gameobjects inside the A level scrollview. Is there some method in UIScrollView or in UIPanel that I can call to recheck those soft clips instead of disable+enable?
Title: Re: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: wallabie on May 12, 2014, 01:57:43 AM
I'm doing a very similar thing and definitely this is a bug in NGUI nested scrollViews.
Title: Re: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: ArenMook on May 12, 2014, 02:31:41 PM
@Agent: My guess is you used Instantiate to create your items instead of NGUITools.AddChild.
Title: Re: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: Agent_007 on May 13, 2014, 01:02:52 AM
@Agent: My guess is you used Instantiate to create your items instead of NGUITools.AddChild.
I am using NGUITools.AddChild (for both red UIGrid items and blue scrollviews).
Title: Re: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: ArenMook on May 13, 2014, 08:43:10 AM
What shader are you using, and how many clipped panels do you have there in total? NGUI's default shaders provide clip support for up to 3 nested clipped panels.
Title: Re: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: wallabie on May 13, 2014, 11:24:39 AM
Not sure what this means. 3 nested cliped panels. In the above situation, how many nested children would that have.
Title: Re: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: Agent_007 on May 14, 2014, 02:25:58 AM
Those panels shown in the image are the only soft clipped ones (I have one UIPanel without clipping as parent for that menu) for that hierarchy, and I am using Unlit - Transparent Colored as shader for all sprites in there. (http://i.imgur.com/LiFPMv7.jpg)
Title: Re: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: ArenMook on May 14, 2014, 06:53:30 AM
Title: Re: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: wallabie on May 14, 2014, 10:05:51 AM
"If it's what I think it is, then it should be fixed in 3.6.0. " Is this answer ? that the problem will be fixed in 3.6 ?
Title: Re: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: ArenMook on May 14, 2014, 11:17:01 PM
I found an issue earlier with scroll view not updating child scroll views when its scrolling offset changes, which resulted in "is visible?" checks not running. That's what was fixed.
Title: Re: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: Agent_007 on May 15, 2014, 02:09:02 AM
The UiPanel changes didn't help. Disable+enable is still required to make soft clip work correctly.
Title: Re: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: ArenMook on May 15, 2014, 11:33:07 AM
In that case I can use a repro case to look at.
Title: Re: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: Agent_007 on May 18, 2014, 12:18:48 PM
I included an scene and script that can be used to replicate the issue.
Just start the scene and press the Show button. Clipping should work incorrectly by default, and once you disable+enable Panel - Submenu it should work correctly.
Title: Re: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: ArenMook on May 18, 2014, 04:27:03 PM
Got it, thanks. I will investigate.
Title: Re: Nested soft clip scrollviews and dynamic scrollview update problem
Post by: ArenMook on May 18, 2014, 04:35:18 PM
Alright, change the UIPanel's Start() function to the following: