Author Topic: "Sticky" Centered Draggable Panel  (Read 2639 times)

rumorgames

  • Guest
"Sticky" Centered Draggable Panel
« on: April 16, 2013, 05:03:54 PM »
I'm having some trouble getting my UIDraggablePanel to behave the way I want it to. For reference, my UI is set up as so:

Anchor
^ Panel (UIPanel, UIDraggablePanel)
^ Grid (UICenterOnChild, UIGrid)
^ Item (BoxCollider, UIDragPanel, UIButton) [3 or more of these in the grid]

The panel is set to MomentumAndSpring and SmoothDragStart is enabled, and the grid is arranged horizontally, with one item centered on the screen at any time, and its neighbors about a third on-screen on either side.

What I'm seeing is that scrolling works just fine for the middle items in the grid, but the first and last items tend to "stick." Swipes, even forcible ones, won't cause the focus to recenter on the next item unless the dividing line between the two crosses the center of the screen. I've tried playing with the MomentumAmount, but I need to drastically increase it to see any improvement, and then the middle items become extremely fickle and easy to swipe past.

I've done a *little* bit of digging and tried logging the mDrag.currentMomentum from within UICenterOnChild, and it seems that swipes on a center item are imparting significantly more momentum - about 10x as much as the same size swipe on the first or last item. Before I waste too much time trying to "fix" this, I thought I should as the pertinent questions:

  • Is this an artifact of me using the tools wrong, in which case how should I go about doing this the right way?
  • Or, is this a known issue, in which case is there a decent and accepted workaround?
  • Or, is this a bug, in which case what can I do to help see that it's fixed?

Thanks in advance for any assistance offered!

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: "Sticky" Centered Draggable Panel
« Reply #1 on: April 16, 2013, 05:11:46 PM »
I've stumbled on some bugs with this as well, because of the iOS scroll emulation. When the element is dragged over the edge (so the content side is inside your clip area), the content only moves half speed of your touch. This is especially troublesome with CenterOnChild.

In the next update, there will be an option on the panel to disable this though.

rumorgames

  • Guest
Re: "Sticky" Centered Draggable Panel
« Reply #2 on: April 17, 2013, 01:20:38 AM »
Interesting, thanks Nicki. Do you suggest I just sit tight until the next update, then? Or are there any actions I can take in the short term to mitigate the issue besides bumping the MomentumAmount way up?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: "Sticky" Centered Draggable Panel
« Reply #3 on: April 17, 2013, 02:11:21 AM »
You can test that fix. Look inside UIDraggablePanel down in about line 566 where it says

  1. //MoveAbsolute(offset);

remove the commenting on that and comment out the next bit with the constraint.


rumorgames

  • Guest
Re: "Sticky" Centered Draggable Panel
« Reply #4 on: April 17, 2013, 06:23:00 PM »
That's exactly what I was looking for! Thanks for the suggestion. It already feels much better and more natural.