Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Quel on January 15, 2015, 01:10:10 PM

Title: Scroll panel didn't refresh fast enough.
Post by: Quel on January 15, 2015, 01:10:10 PM
Hi

I'm working with dynamic Scroll Views. In my case I have some Scroll Views that moves and resize at run-time. Apparently nothing so difficult. But ... looks like the panels didn't refresh fast enough, so some "empty spaces" or "overlapping elements" appear during the fast transitions.

Some details:
- Looks like the problem occurs when Scroll panels are moving and resizing. But not when they just resize.
- I use Anchors to set panel sizes.
- Panels are moved by their parents.
- Those parents are moved by Tweens.

How can I fix that ? Or how can I force Panel refresh to avoid that annoying issue.

Thanks.
Title: Re: Scroll panel didn't refresh faste enough.
Post by: ArenMook on January 15, 2015, 08:55:33 PM
Not sure what I'm looking at in your screenshot. If you want anchors to refresh immediately, then do just that -- UIRect.UpdateAnchors function. You can also rebuild draw calls immediately on the panel by using UIPanel.RebuildAllDrawCalls.
Title: Re: Scroll panel didn't refresh fast enough.
Post by: Quel on January 16, 2015, 02:55:31 AM
Oh!. I was using *.ResetAnchors() instead *.UpdateAnchors(); Now if looks like it's drawing correctly. Thanks.

But ... one last question. What's the difference between ResetAnchors and UpdateAnchors ?

Title: Re: Scroll panel didn't refresh fast enough.
Post by: ArenMook on January 18, 2015, 04:09:03 AM
ResetAnchors should be used after you set anchors manually such as via widget.leftAnchor.Set(...). Although in most cases you'll want ResetAndUpdateAnchors() instead.