Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: wallabie on May 11, 2014, 02:02:36 AM

Title: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 11, 2014, 02:02:36 AM
I'm trying to put a horizontal scrollview inside of the accordion Example 9 .  Here is a link to the prefab with the problem. 

https://dl.dropboxusercontent.com/u/48378123/Accordion_ScrollView_jumping.prefab

Steps to reproduce problem:
1. click header "Exciting Delivery Quest" to expand.
2. drag the items in the scrollview to the left.
3. click header to close.
4. Repeat 1-3 a few times to see the header jump to the right.

Perhaps I've got something setup incorrectly.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 12, 2014, 01:56:49 AM
Found that there are major bugs in nested ScrollViews. 
Can you please check out this problem.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: ArenMook on May 12, 2014, 02:28:56 PM
Attaching a prefab on it rarely effective on its own. You need to create a Unity package. All I see is a blank prefab on my end.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 12, 2014, 11:32:00 PM
This is easy to make.

1. Take NGUI Example 9.
2. Add a horizontal scrollView to each of the Accordion Item. 
3. Add a bunch of buttons as children of the horizontal scrollView.
4. Drag the children buttons to the left, close and open the accordion, the tweening, enabling/disabling will cause the jumping.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 13, 2014, 11:28:01 AM
This has nothing to do with re-parenting yet this same problem is appearing in my other scrollview questions.

Can you please  check this jumping problem.  Btw, how much testing did you do with the new version of Nested ScrollView starting from 3.5.6 ?
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: ArenMook on May 14, 2014, 05:31:41 AM
Following your instructions I see one major problem -- child scroll views get scaled by the tween. Panels must have a uniform scale. Tween is scaling things non-uniformly. This breaks clipping, and worse.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 14, 2014, 10:02:30 AM
Not sure what this means.  How would this be fixed.

Let me ask this question in another way.  I need an accordion component that is like example 9.  Instead of each accordion item having text, I need a horizontal scrollview.  The behavior should be like that of example 9.  clicking on one of the accordion item should collapse or expand to show or hide the horizontal scrollview. 

Since the NGUI has problems with tweening the panel,  how should the above be made?
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: ArenMook on May 14, 2014, 11:14:42 PM
You need to find a way that doesn't involve breaking uniformness of a panel.

Tween the content, not the panel.

UIPanel
- Content (tween this)
-- Widget 1
-- Widget 2
-- Widget 3
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 15, 2014, 10:01:27 AM
In your NGUI example 9, the structure is:

SubPanel
--Table
   -- Quest1
       -- Label - Title
       -- SlicedSprite(Row Outline)
       --Tween
          -- Label - Description

If I want to put in a horizontal scrollView under the Quest1, where in the structure would it go ?

Edit:  Here is the unity package that demonstrate the problem.

https://dl.dropboxusercontent.com/u/48378123/NestedScrollViewProblem.unitypackage

I'm using NGUI 3.5.9

Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: ArenMook on May 15, 2014, 11:21:33 AM
Your elements are not positioned properly from the start. Select the grid -- right click -- execute. Select the scroll view -- right click -- execute. There is still an offset of about 2 pixels there, but it's easily resolved by moving the content by 2 pixels to the left so that it lies on the edge of the scroll view properly.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 15, 2014, 01:18:00 PM
I followed your instructions and still the same jumping/disappearing problem.

Here's how to reproduce.
1.  DRAG the buttons to the LEFT.
2. CLOSE and OPEN the quests
3. Repeat a few time if you don't see the jumping and sometimes everything disappears.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: ArenMook on May 16, 2014, 12:53:52 PM
I see. I'll investigate, thanks.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: ArenMook on May 16, 2014, 01:49:06 PM
Open up NGUIMath.cs and replace the CalculateRelativeWidgetBounds function on line 404 with this one:
  1. /// <summary>
  2.         /// Calculate the combined bounds of all widgets attached to the specified game object or its children (in relative-to-object space).
  3.         /// </summary>
  4.  
  5.         static public Bounds CalculateRelativeWidgetBounds (Transform relativeTo, Transform content, bool considerInactive)
  6.         {
  7.                 Bounds b = new Bounds(Vector3.zero, Vector3.zero);
  8.  
  9.                 if (content != null)
  10.                 {
  11.                         bool isSet = false;
  12.                         Matrix4x4 toLocal = relativeTo.worldToLocalMatrix;
  13.                         CalculateRelativeWidgetBounds(content, considerInactive, ref toLocal, ref b, ref isSet);
  14.                         if (isSet) return b;
  15.                 }
  16.                 return b;
  17.         }
  18.  
  19.         /// <summary>
  20.         /// Recursive function used to calculate the widget bounds.
  21.         /// </summary>
  22.  
  23.         [System.Diagnostics.DebuggerHidden]
  24.         [System.Diagnostics.DebuggerStepThrough]
  25.         static void CalculateRelativeWidgetBounds (Transform content, bool considerInactive, ref Matrix4x4 toLocal, ref Bounds b, ref bool isSet)
  26.         {
  27.                 if (content == null) return;
  28.                 if (!considerInactive && !NGUITools.GetActive(content.gameObject)) return;
  29.  
  30.                 UIWidget w = content.GetComponent<UIWidget>();
  31.                
  32.                 if (w != null && w.enabled)
  33.                 {
  34.                         Vector3[] corners = w.worldCorners;
  35.  
  36.                         for (int j = 0; j < 4; ++j)
  37.                         {
  38.                                 Vector3 v = toLocal.MultiplyPoint3x4(corners[j]);
  39.                                
  40.                                 if (isSet)
  41.                                 {
  42.                                         b.Encapsulate(v);
  43.                                 }
  44.                                 else
  45.                                 {
  46.                                         b = new Bounds(v, Vector3.zero);
  47.                                         isSet = true;
  48.                                 }
  49.                         }
  50.                 }
  51.  
  52.                 for (int i = 0, imax = content.childCount; i < imax; ++i)
  53.                 {
  54.                         Transform child = content.GetChild(i);
  55.                         UIPanel p = child.GetComponent<UIPanel>();
  56.                        
  57.                         if (p != null && p.clipping != UIDrawCall.Clipping.None)
  58.                         {
  59.                                 Vector3[] corners = p.worldCorners;
  60.  
  61.                                 for (int j = 0; j < 4; ++j)
  62.                                 {
  63.                                         Vector3 v = toLocal.MultiplyPoint3x4(corners[j]);
  64.  
  65.                                         if (isSet)
  66.                                         {
  67.                                                 b.Encapsulate(v);
  68.                                         }
  69.                                         else
  70.                                         {
  71.                                                 b = new Bounds(v, Vector3.zero);
  72.                                                 isSet = true;
  73.                                         }
  74.                                 }
  75.                         }
  76.                         else CalculateRelativeWidgetBounds(child, considerInactive, ref toLocal, ref b, ref isSet);
  77.                 }
  78.         }
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 17, 2014, 01:03:03 AM
Cool, I applied the fix, it seems to fix the Dragging the left problem.  Haven't tested extensively.

There are other bugs still lingering:   

1.  When collapsing/opening the accordion item, the first button is black ( intermittently).
2.  Quest 2 is only text, Quest 3 has the grid, but the Grid shows up in Quest 2.

In general there are many issues with nesting scrollviews and you really need to test this functionality more thoroughly instead of us having to beta test this for you.  I've spent over 5 days trying to figure out what the problem is.  Basically the request is to have a simple accordion working with a horizontal scrollView for each of the accordion item.  This is a simple GUI component that should just work.

Here's a package that shows the problem.
https://dl.dropboxusercontent.com/u/48378123/NestedSV_Problems.unitypackage
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: ArenMook on May 17, 2014, 05:38:03 PM
I already mentioned earlier that non-uniform scaling of panels breaks clipping, and you are still trying to do it...

As for the button becoming black.. it's not black. It's brown, and it happens because there is a TweenColor attached to the "Tween" object, and since it's a plain old game object, it tries to find the actual object to tween underneath it. The example was written with a single object in mind -- the label, so it was clearly finding the right one. In your case you have many things underneath, so it ends up finding the wrong one -- your first button, which in turn conflicts with the button's own tween color (from the UIButton component).

Lastly, the position of the scroll view from the 3rd quest is exactly where you placed it -- above the item. You're the one that gave it the position of (78, 57, 0).
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 17, 2014, 09:37:10 PM
I'm a newbie at NGUI, you are the creator of NGUI.  So my request has been.  How to make a simple ACCORDION with Horizontal scrollers inside.  This is a very basic component in any GUI package.

So, how can this be done with NGUI.  As you can see, I've tried over 5 days with all sorts of headaches and have not managed to do it because of this or that problem.  Can you do me a favor and send me a unity package of an example that works. This component will be dynamically populated so please test it with this in mind.  Everything the app is dynamically populated, nothing is done by hand because all the data is coming from the server.

Edit:  I also own DaikonForge and it takes less than 5 minutes to get this simple component to work and so far it's taken me more than 5 days with NGUI with the same thing.  First we got problems with the dragging to the left due to a NGUI.Math problem, then we run into the UIpanel cannot be tweened,  then when dragging and dropping we have another bug where we cannot get the correct order of the objects due to a hack that didn't get properly tested.  I didn't have any of these problems with the SAME Accordion with Daikon.  I would have to say that this is one component in NGUI that really needs some proper implementation.  FYI, mobile components use a lot of ScrollViews and in the future, more users will discover the same problems with NGUI's scrollviews.

Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: ArenMook on May 18, 2014, 11:16:37 AM
Here you go. This took me less than a minute to set up, so what does that say? Nothing. Different packages have different strengths and weaknesses, but they are ultimately limited by the knowledge of the person using them.

The key is to not use TweenScale. As I mentioned, scaling a scroll view non-uniformly is a big no-no in NGUI because of a serious limitation in Unity itself (the way it combines scaling, and the lack of transform.scale). Forego that, and everything works peachy. In essence all I did is replace your TweenScale with TweenHeight.

Note that this scene requires Unity 4.3.4 and NGUI 3.6.0.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 18, 2014, 11:52:31 PM
Ok, I'm downloading 3.6 and going to try this repo. 
If it took 1 minute, then why didn't you do this earlier and save me the headache of 5 days.  Actually, it took five days because of numerous bugs that had to be fixed.  All I can say that moving forward, I hope you see that the use of scrollView is going to increase so please make this part of NGUI much more Solid so that we do not have to suffer.  Using NGUI is supposed to be a joyful experience.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 19, 2014, 12:43:24 AM
Unfortunately there are more problems.

I mentioned before that the ScrollView will be populated Dynamically.  In the first quest, I made all the buttons to have xpos = 0, as you can see, they are all bunched up and not spaced out correctly when played.  As a comparison I made the same scrollView that's not nested at the bottom and it works fine. 


https://dl.dropboxusercontent.com/u/48378123/NestedSV_ItemsAllBunchedUp.unitypackage
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: ArenMook on May 19, 2014, 12:51:15 PM
wallabie, if you want faster turn around, you need to obtain a Professional license. I've mentioned this before. Professional version is the same repository I'm working with. It lets you get fixes immediately rather than waiting days for them. So far you have not even provided me with the OR# or your standard license even, let alone Pro.

Alternatively, help me cut down support time by helping others and answering some of the questions. I have only so much time in a given day, and I have to do support, development, and bug fixes. Help me help you. If I simply do all the work for everyone by providing an example for everyone who asks rather than keeping it short and explaining the cause, letting them figure out the issue and solution on their own... how can they expect to learn anything? Haven't you ever heard of the "give the man a fish" expression?

As for your remaining issue... Execute the grid, reset clipping position. I mentioned this before. You need to do this after populating your scroll views as well.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 19, 2014, 02:14:59 PM
I'm not asking for a fish. 

Of course I did Reposition() and ResetPosition() after populating but still the same problem.  Comes in looking very weird.  Where is your test project that demonstrates that your fix works ?  On the other hand, I sent you a repos that shows how it doesn't work.

All I'm asking is for a simple Bug free Accordion that works...  It's taken now 7 days with a number of bug fixes on your part just to get a semi working accordion that takes 5 minutes to setup in Daikon. 

Let's examine the series of events related to getting the nested accordion to work:

1. Item dragged to the left breaks the component.  Math bug. Had to be fixed. Took 3 days before you saw that it was your code's problem.

2. Nested scrollView cannot be Tweened. Don't use Non-uniform Tween I tell you. Then you came up with a Fix that uses Tween height instead of Tween Scale.  So yes, do not use non-uniform tween.  Took 2 days.

3. Reordering of the items does not work because ... well, "don't trust what unity gives you". Turns out the fix was the hack code forgot to take into account of the sorting.  Hack was not properly tested.  Took 3 days.

4. NOW, there is another problem still with your last 1 minute Fix.

I sent you a repos to show the problem. Instead of screaming that I am demanding your help, it's more like we should get paid for Beta testing. 

Edit:  FYI, most of my request for your "Help" on the forum  has turned out to be request to "Fix Bugs".  The forum is very good because it keeps very good records and it doesn't lie.  Just examine the facts for yourself.   Actually, the BEST HELP you can give is to do better testing and hire someone for QA instead of throwing out beta ware and making us suffer and begging for bug fixes.

P.S. I sent you my OR.




Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: Nicki on May 19, 2014, 04:51:17 PM
The forums do indeed keep a good record and your sense of entitlement is unduly high. Be cool, guy, you're being helped.

Fact is, you're trying to do something quite specific (nested accordion) that NGUI doesn't have built-in. Now, it's possible to make that work, because the components for an accordion are there. Nesting panels is a brand new feature, so it's bound to have kinks and bugs. 1 month ago it would just not have been possible at all and the argument would stop there. So you have the privilege of being one of the first to brave these new waters. We're here to help, with guidance, bug fixes and whatever else we can help with given our limited time.

As for the resistance you've felt, you must realize that there are many users on here saying "X doesn't work", "Y doesn't work as I expected", "I paid this and this, so make my stuff for me now rah rah".

While they are sometimes right, they are often not, and are instead just using it wrong. Answering posts like those is (often) trivial, "use A instead of X", "Y works right if you just use B first", "make your own stuff" etc. Sometimes genuine bugs gets overlooked or thought of as user error or it takes some time to actually fix the bug, that's just how it is when it's a one man operation. Sometimes you'll get some resistance to what you think is a bug, because it didn't break in the simple tests. When you have specific repos that break consistently, they're looked at and fixed if the bug can be identified. It doesn't happen instantly, but that's because there are hundreds of other support requests on here that also requires attention.


Aanyway re the current issue:
If you want your dynamically filled objects to placed correctly, leave the UIGrid enabled. You can have another component disable it again after all your objects are filled in. I just did that in the repo you posted and it seems to work fine on my end. Is there anything else you're doing that might be breaking it?
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 19, 2014, 10:39:36 PM
"Fact is, you're trying to do something quite specific (nested accordion) that NGUI doesn't have built-in. " NGUI's been here for 2+ years, Daikon is much shorter and their component architecture just works. 

"I paid this and this, so make my stuff for me now rah rah"
I don't think that Nested ScrollViews with a working basic Accordion is a custom demand.  Just look at every other GUI package and see for yourself.  Quite the contrary, Nested ScrollViews are a BASIC functionality so are accordions. 

"1 month ago it would just not have been possible at all and the argument would stop there"
No it did not stop here, I was the one who requested this feature 3 months ago because I was Shocked to find out that NGUI did not support this basic functionality.  It's incredible what NGUI community of users are putting up with.  NGUI is heavily promoting Mobile use. How can this package work on mobile where most of the GUI's are built on nested ScrollViews. Open your phone and see for yourself. This is 2014.

"that's just how it is when it's a one man operation." - This package has grossed over $950,000.  The competitor, Daikon around $400,000 and they have 2 full-time plus extra help.  A business that grosses almost a million and have 10+ thousand customers should NOT be run by one man.  How would you feel if Unity didn't hire programmers for its company and when you ask for bugs to be fixed or features implemented, they tell you, sorry, we only have the 3 founding members as programmers on our staff.  Wouldn't you say that these 3 founders are trying to keep all of the money for themselves.  The reality is that NGUI has become a business in its own right with thousands of customers worldwide, given this scale and revenue, it really needs at least 2 full-time programmers, one full-time QA/support/customer relations.

The solution:
"If you want your dynamically filled objects to placed correctly, leave the UIGrid enabled."
Can you post a link to  your working repos, if it works, then surely I will shut-up and know that it's my problem. 
 




Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: ArenMook on May 20, 2014, 01:15:27 PM
Curious how every time you post about NGUI's grossed sales, which have not been mentioned anywhere, the number seems to grow.

Wallabie, this will be your one and only warning.

Your posts contribute nothing to the community. They only demand things that you deem necessary. It's amusing how you keep quoting some high number, and yet also seem to think that your opinion, your desires, and your issues are the only ones that I have to address. You behave like you paid me a million dollars and now own me, and everyone else's needs and desires simply don't exist.

NGUI's support is a privilege given freely -- at no cost to devs. You aren't paying me for support, are you? The source code provided in NGUI more than makes up for $95 spent. And if it doesn't -- no big deal. There are other UI solutions that you are well aware of and keep mentioning in every post you make. What I don't understand is why you are still here. If XYZ is better, why not use XYZ? Go use it, and don't let someone like me hold you back.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: Nicki on May 20, 2014, 04:21:19 PM
Customers vote with their wallets. If they feel the support (or whatever else) isn't good enough, they won't buy.

Anyway, I just enabled the UIGrid in the exact unitypackage you posted below and manually placed the elements in the grid at 0,0,0. Clicking the "fold open" on the button with those elements in repositioned them just fine. I think that should solve the latest problem, but you might be inserting your elements in a different timing, like say when you open the nested scroll, which would potentially cause a 1 frame delay.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 20, 2014, 10:38:29 PM
@ArenMook,

You are correct, You do not Owe anyone anything and I never said I Own you.  It's not about Ownership.  It's about business.

You make a product which has certain Claims...  Mobile support.  Well, it's lacking nested scrollviews which currently mobile users Absolutely need.  If you feel that I am the ONLY one who needs this, then ask your user base.  How many people Vote for Nested ScrollViews and have a Working Accordion. 

"Source is Available"
It's quite common practice for most of the GUI packages to have the source code available.  This is great,  people want the source to study how the package works and make custom things should they need it.  However, what good is the source if the code is not working properly.  We bought the package because it's stable and really no one wants to buy something so that they can spend days pulling their hair out wondering why things don't work.  If it's a car, it's called a lemon.

"NGUI's support is a privilege given freely -- at no cost to devs. You aren't paying me for support, are you?"

There is confusion here between "Bug Report" and "Support",  I'm not asking for support. I'm asking that the Bugs be fixed.  This is very different from you giving me support to help me with MY problem.  A bug is NGUI's problem.   In this nested accordion situation, I have been discovering Bugs in your code, and therefore have served the function of  QA.  Instead of you supporting me, I am giving Free QA support.  Finding the bugs, taking time to make a repos and explaining what the problem is.   I don't understand why you do not see this difference.  Also if you want to continue this kind of thinking that only you are giving away Free Support, why not consider the enormous amount of Free QA support you have received from people who have bought this package and have contributed ideas and bug reports to make the product even a better seller for you.  All for Free and you are the one to receive the monetary benefits.  Compare NGUI 2 yeas to where it is now.  These improvements and ideas are not coming out only of your head.  It's a collective set of ideas from your Paying users and even from Unity.  So let's see things in the correct balance.

Why do I mention the gross sales of this package?  Because it's not a lemonade stand, it's a professional business that's generating real revenues and serving 10+ thousand users.  How do you suppose to go on doing everything yourself, there's not enough time in the day or night.

As for NGUI's revenue: It's not rocket science to get the numbers, we know that it's been on the top Grossing List for over 2 years consistently.  From another top grossing asset like Shader Forge chart we can get a good idea of how many copies NGUI would have sold over the past 2 years.  Added the fact that Everyone Needs a GUI whereas not everyone needs a Shader forge.  NGUI to this day is still number 1 on the Top Grossing chart and it will be a number of months to go before Unity Gui comes out.  More time for more sales.

http://forum.unity3d.com/threads/222049-Shader-Forge-A-visual-node-based-shader-editor/page64



Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 20, 2014, 11:08:27 PM
Also as I mentioned before, why I'm using NGUI is because  mobile performance is still better than any of the other packages.  Daikon is catching quickly but still not yet there.  Like you said before, there are advantages and disadvantages to each package.  Luckily NGUI still has the performance edge, otherwise everyone would be using Daikon.  Where NGUI is lacking is solid support for Nested ScrollViews and more built-in components. 

If you think that my requests have only been for me, then  look back at my previous postings and you will see that my requests have been in the past 3 months have been:

1. Data Bindings
2. Parameterized Events.
3. Nested ScrollViews.
4. More built-in components to match Daikon.

As it turns out, you yourself have added these most of these features and NGUI users have benefited greatly. 
If you've added most of these features then what's the problem?

Problem is that Nested Scrollviews implementation did not go through QA, it was well, half-baked.  It took a number of bugs to get fixed and days to get the thing working.  From your postings, you seem to place a lot of emphasis on your time being very valuable, well, my time to me is also very valuable and I do not want to spend it finding and submitting bug reports.  How would you feel if you were making a project and put in a Daikon Accordion which works in 5 minutes and then try to do the same with NGUI and it takes 5 days.  I had to suffer through this painful experience so that the rest of NGUI users do not have to in the future. 
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 21, 2014, 12:44:14 AM
@Nicki,

Thanks for getting to the point of the problem. I tested your finding in the app with dynamic data and it works.
Finally, it's working.  Let's go and celebrate.  At least now NGUI now has a working nested Accordion -- fingers crossed until the next bug.   This could be added to the NGUI example scenes.  I'm sure that many people would like to see and use this component.

Edit:  Spoke too soon, it's correctly displaying the items but when scrolling up and down, the inner scrollView items are not being clipped.  I have to first open and close the accordion item then the inner scrollView items gets clipped properly.  Note: The component works perfectly fine when the items have been created before hand, the problem appears when it's dynamically populated.

Here's a link to the video:

https://dl.dropboxusercontent.com/u/48378123/NestedNotClipping.mp4

I don't have time to make another repos at the moment.  Can you do me a favour and do more testing on your end.  I have a feeling that this is not the end of the nested scrollView story.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: Nicki on May 21, 2014, 05:24:00 AM
I'll take a look when I get home, it seems like the panels aren't talking together properly.
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: ArenMook on May 21, 2014, 12:02:32 PM
@wallabie: I vaguely remember there being a similar post in the last ~3 days about dynamically instantiated items within nested scroll views not being clipped properly. That was indeed a bug that I've looked into and fixed. Nicki won't see it because he's on the latest Pro version which had it fixed on the 18th.

The fix was to delete the UIPanel.OnEnable function then change ParentHasChanged and OnInit functions to these:
  1.         /// <summary>
  2.         /// Find the parent panel, if we have one.
  3.         /// </summary>
  4.  
  5.         void FindParent ()
  6.         {
  7.                 Transform parent = cachedTransform.parent;
  8.                 mParentPanel = (parent != null) ? NGUITools.FindInParents<UIPanel>(parent.gameObject) : null;
  9.         }
  10.  
  11.         /// <summary>
  12.         /// Find the parent panel, if we have one.
  13.         /// </summary>
  14.  
  15.         public override void ParentHasChanged ()
  16.         {
  17.                 base.ParentHasChanged();
  18.                 FindParent();
  19.         }
  20.  
  21.         /// <summary>
  22.         /// Mark all widgets as having been changed so the draw calls get re-created.
  23.         /// </summary>
  24.  
  25.         protected override void OnInit ()
  26.         {
  27.                 base.OnInit();
  28.  
  29.                 // Apparently having a rigidbody helps
  30.                 if (rigidbody == null)
  31.                 {
  32.                         Rigidbody rb = gameObject.AddComponent<Rigidbody>();
  33.                         rb.isKinematic = true;
  34.                         rb.useGravity = false;
  35.                 }
  36.  
  37.                 FindParent();
  38.                 mRebuild = true;
  39.                 mAlphaFrameID = -1;
  40.                 mMatrixFrame = -1;
  41.  
  42.                 list.Add(this);
  43.                 list.Sort(CompareFunc);
  44.         }
Title: Re: Example 9 with Horizontal Scrollview jumping when clicked.
Post by: wallabie on May 21, 2014, 11:17:06 PM
@ArenMook,

Holy Cow, It works. Oh, my god, you don't know how happy I am.

I remembered a time not long ago before the Nested Scrollview when it was more fun working with NGUI. 

Please continue to make this Nested Thing more Solid and the Accordion is a very often used component.  If you could set aside a bit of time to test the Accordion and improve on the functionality it would be greatly appreciated.


Thanks a bunch.