Author Topic: Scrolling panel moves instead of grid  (Read 22642 times)

Befall

  • Guest
Scrolling panel moves instead of grid
« on: April 21, 2013, 05:01:48 PM »
Hey all,

I've searched and tried to find an answer from http://www.tasharen.com/forum/index.php?topic=2723 and http://www.tasharen.com/forum/index.php?topic=2722, but nothing has helped thus far.

I'm trying to do a simple vertical scrollbar, but no matter what I do, it just moves with the scroll instead of the grid.

All items have 1:1:1 scales, everything actually being (1,1,1) except for the root. Attached is pics of the issue and my hierarchy. Any help would be appreciated.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scrolling panel moves instead of grid
« Reply #1 on: April 21, 2013, 07:13:10 PM »
I suggest double-checking your setup, comparing it to what I have in the scroll view examples. You must be using UIDragPanelContents with a UIDraggablePanel. The way scrolling is done is that the panel moves in one direction, and clipping gets adjusted to move in the opposite direction, thus producing the effect of the clipping standing still and contents moving.

Befall

  • Guest
Re: Scrolling panel moves instead of grid
« Reply #2 on: April 25, 2013, 05:18:20 PM »
I don't know what to say besides that I quintuple checked every aspect of every component, and it's identical. Scripts of it are:

Root: UI Root
   Camera: Camera, UICamera
      Anchor (Center): UIAnchor
         Panel (Clipped): UIPanel, UIDraggablePanel (Vertical Scroll Bar links to Scroll Bar)
            Grid: UIGrid
               Items: Box Collider, UIDragPanelContents (Draggable Panel set to Panel (Clipped))
         Panel (Window): UIPanel
            Scroll Bar: UIPanel, UIScrollBar
               Background: UISlicedSprite, UIEventListener
               Foreground: UISlicedSprite, UIEventListener

I've gone one by one and checked every single aspect. Any idea exactly what could cause my specific problem?

Befall

  • Guest
Re: Scrolling panel moves instead of grid
« Reply #3 on: April 25, 2013, 06:04:22 PM »
Checking out the "Quest Log" example, it uses a UITable instead of a UIGrid. What's the difference for a scrolling list of items?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scrolling panel moves instead of grid
« Reply #4 on: April 26, 2013, 01:48:51 PM »
Based on what you posted I don't actually see anything wrong. Table and grid are just different ways of positioning children.

agentsmith666

  • Guest
Re: Scrolling panel moves instead of grid
« Reply #5 on: May 23, 2013, 02:49:39 AM »
@ArenMook- For the life of me I still don't understand why you're hesitating on making an example.  Even last year:
http://www.tasharen.com/forum/index.php?topic=355.0

We had this problem and you never came out with an example.  I followed your directions as with the other posters in the other thread and we all still couldn't get it to work.  Yes your Quest log example works but that's a UITable not a UIGrid. 

"Based on what you posted I don't actually see anything wrong. Table and grid are just different ways of positioning children."

Ok but it's still not working so please create an example with vertical bars and a UIGrid.

Thanks!


Dover8

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 20
    • View Profile
Re: Scrolling panel moves instead of grid
« Reply #6 on: May 23, 2013, 04:50:50 AM »
Have you got "Static" checked on the Panel? And set up the right Scale in the UIDraggablePanel? And your items are referencing the correct UIPanel?

I'm working on a scroll grid myself at the moment and was wondering if there is a method available for getting which item/gameObject is in the center of the scroll?

I'm also noticing that when I scroll using the mouse that when you reach either end, the final item doesn't move all the way into the middle, but it will if you have click dragged when you release the mouse button? Is there a way to make sure it snaps into the middle when using the mousewheel?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scrolling panel moves instead of grid
« Reply #7 on: May 23, 2013, 12:01:27 PM »
@agentsmith: main reason? Because there is nothing to it. Perhaps this video will help.

http://www.screencast.com/t/kYAgUyVBM9

agentsmith666

  • Guest
Re: Scrolling panel moves instead of grid
« Reply #8 on: May 23, 2013, 02:30:31 PM »
@ArenMook- Thank you it helped out a lot.  I think the missing step from the other thread was changing the Scale from X to Y in the UIDraggable Panel.

http://i.imgur.com/fr1s0wz.jpg