Author Topic: scrollview bouncing  (Read 2452 times)

dangalg

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
scrollview bouncing
« on: July 11, 2016, 02:32:14 PM »
Hey!
I am trying to get the scrollview to work but am encountering multiple problems.
1. I set the scrollview to vertical scrolling and when I scroll when I reach the end the scrollview moves to the side, on the horizontal.
2. When I scroll and reach the end the scroll view doesn't come back to the top...
3. Somtimes the scrollview gets an offset to the side. And it says on the attached uipanel that there is an x offset. I want it moving only up and down how do I set this?
« Last Edit: July 12, 2016, 12:20:40 AM by dangalg »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: scrollview bouncing
« Reply #1 on: July 13, 2016, 10:43:45 AM »
Well, seeing as NGUI's scroll views don't have any bouncing logic built-in, I'm going to venture a guess here that the issue is in whatever code you're using for the bouncing logic. I can't help you much with that.

dangalg

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: scrollview bouncing
« Reply #2 on: July 21, 2016, 02:40:42 AM »
There is no bouncing code. It's when I scroll with the mouse the scrollview moves horizontally, it gets an offset. And I only want it to move vertically. I set everything to only vertical movement.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: scrollview bouncing
« Reply #3 on: July 21, 2016, 12:06:10 PM »
UIDragScrollView script, assuming that's what you placed on items, merely forwards events to the UIScrollView. The dragging logic happens in UIScrollView.Drag. If the movement is really set to vertical, offset.x gets set to 0, so the move command that follows should never move the panel on the X.

Below the move code there is the constrain code that runs if "restrict within panel" option is turned on, but again that one too will not allow horizontal movement if it's set to vertical.

Make sure you don't have any scroll bars attached set to horizontal movement. That might affect it. Aside from that, add a Debug.Log to UIPanel.clipOffset property setter to see where it's being called from.

dangalg

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: scrollview bouncing
« Reply #4 on: January 22, 2017, 07:00:58 AM »
What panel is this referring to? My scroll view only moves up 100 px and down 100 px? how do I set the panel size by the size of the object within it?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: scrollview bouncing
« Reply #5 on: January 23, 2017, 08:17:19 AM »
Select the UIPanel object in inspector, this will give you the pink outline with draggable handles (assuming you have the Rect mode selected [press 'T']). You can adjust the size and move the panel around freely.