Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started 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.
-
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.
-
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 ?
-
ResetAnchors should be used after you set anchors manually such as via widget.leftAnchor.Set(...). Although in most cases you'll want ResetAndUpdateAnchors() instead.