Author Topic: Scroll View Snap to Item and Drag Issue  (Read 22178 times)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scroll View Snap to Item and Drag Issue
« Reply #15 on: June 05, 2012, 11:40:51 PM »
SpringPosition is not meant to be moving drag panels. You're looking for SpringPanel.

MetaMythril

  • Guest
Re: Scroll View Snap to Item and Drag Issue
« Reply #16 on: June 08, 2012, 11:49:19 AM »
SpringPosition is not meant to be moving drag panels. You're looking for SpringPanel.

Thanks, starting to get it now.

soulis6

  • Guest
Re: Scroll View Snap to Item and Drag Issue
« Reply #17 on: June 19, 2012, 01:39:08 PM »
Not to the panel but to whatever you're dragging. The same object that has UIDragPanel.

Hello, i'm trying to get this same thing to work in our project, and this is where i'm running into trouble, figuring out what object(s) to use SpringPosition on.

I don't have any script called UIDragPanel in the newest version of NGUI, was that renamed? Is it UIDraggablePanel? If so, when trying to use SpringPosition on the panel with UIDraggablePanel on it, it moves the entire panel, clipping and all, which is not useful.

Are you supposed to use it on each of the child objects? If so the SpringPosition works fine on that one particular object, but then it doesn't get re-organized by the grid.

I would really appreciate any help with this, as I just can't seem to figure out how it's supposed to be set up.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scroll View Snap to Item and Drag Issue
« Reply #18 on: June 19, 2012, 01:47:51 PM »
UIDragPanelContents is he script that should be attached to colliders, and UIDraggablePanel is the script that should be attached to the panel.

soulis6

  • Guest
Re: Scroll View Snap to Item and Drag Issue
« Reply #19 on: June 19, 2012, 02:03:26 PM »
Thanks for the quick response. I get the set-up of the scroll list, and the scroll list itself works perfectly, along with finding the closest one to the center of the screen and scaling that one up.

My question is regarding the SpringPosition, and what you're supposed to use that on in order to get the snapping scroll list.

thanks again for your time.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scroll View Snap to Item and Drag Issue
« Reply #20 on: June 19, 2012, 02:21:13 PM »
It should be SpringPanel, not SpringPosition, and you should use it on the panel's game object.

soulis6

  • Guest
Re: Scroll View Snap to Item and Drag Issue
« Reply #21 on: June 19, 2012, 05:06:29 PM »
Ahhh that was my problem. Thank you very much! Works beautifully now!

RocketPop Games

  • Guest
Re: Scroll View Snap to Item and Drag Issue
« Reply #22 on: November 15, 2012, 04:29:56 PM »
For the convenience of future Googlers / searchers... There is a component UICenterOnChild that you can put on the UIGrid that does all this for you now...