Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Befall 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.
-
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.
-
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?
-
Checking out the "Quest Log" example, it uses a UITable instead of a UIGrid. What's the difference for a scrolling list of items?
-
Based on what you posted I don't actually see anything wrong. Table and grid are just different ways of positioning children.
-
@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!
-
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?
-
@agentsmith: main reason? Because there is nothing to it. Perhaps this video will help.
http://www.screencast.com/t/kYAgUyVBM9
-
@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