Author Topic: Scroll panel didn't refresh fast enough.  (Read 3360 times)

Quel

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 11
    • View Profile
Scroll panel didn't refresh fast enough.
« 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.
« Last Edit: January 16, 2015, 02:45:50 AM by Quel »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scroll panel didn't refresh faste enough.
« Reply #1 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.

Quel

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Scroll panel didn't refresh fast enough.
« Reply #2 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 ?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scroll panel didn't refresh fast enough.
« Reply #3 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.