Author Topic: ScrollView and ScrollWheel  (Read 4891 times)

Xaren

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
ScrollView and ScrollWheel
« on: November 07, 2014, 09:44:13 AM »
Hi !

I might be missing something but I'm having an issue with having the mouse wheel work with my scrollview, here's my hierarchy :

UIPanel + UIScrollView + ChatTable
     UIScrollBar + Box Collider

I tried adding a Drag Scroll view and it "worked" (I might have needed to tweak it more) but I don't want the "drag" part of the drag scroll view. It feels like it should work without using this anyway. Am I missing something ?

Thanks in advance !

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ScrollView and ScrollWheel
« Reply #1 on: November 07, 2014, 04:19:59 PM »
Scroll bar must be outside your scroll view. Table should be a child of the scroll view.

Root
- UIPanel, UIScrollView
-- Chat table
- Scroll bar

Xaren

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: ScrollView and ScrollWheel
« Reply #2 on: November 10, 2014, 04:07:51 PM »
I now have this and it still doesn't work :

-UIPanel | UIScrollView
-- UITable
--- ScrollableContent
-UIScrollBar
--Up Button / Down Button / Background / Foreground / Thumb

Any idea ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ScrollView and ScrollWheel
« Reply #3 on: November 10, 2014, 10:07:41 PM »
What does "doesn't work" entail, exactly? Your original post talks about you not wanting the drag operation of the scroll view, but want the scrollwheel, if I understood it correctly. The scroll view that comes with NGUI does both -- that's what UIDragScrollView script does. If you want only one of them, create a script that would do only what you want inside and use it instead of UIDragScrollView.

Xaren

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: ScrollView and ScrollWheel
« Reply #4 on: November 11, 2014, 08:08:44 AM »
Hummm I just realised something. Is this an error or you just talked about UIDragScrollView ? In you last post you said UIScrollView like I want to, but does that mean there's only the dragview that can be used with the scrollwheel ?

Also when I'm saying it doesn't work, I mean that the wheel isn't working.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ScrollView and ScrollWheel
« Reply #5 on: November 12, 2014, 07:26:06 AM »
UIScrollView is what can be dragged around.

UIDragScrollView is the script placed on items inside your scroll view as well as any collider you want to make it possible to move the UIScrollView around.

UIDragScrollView is what drags the UIScrollView. You would normally place UIDragScrollView on every single collider within the scroll view, as well as on the background object.