Author Topic: 2 Scrollviews in 1 Window  (Read 2107 times)

UltraTM

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 5
    • View Profile
2 Scrollviews in 1 Window
« on: December 31, 2014, 03:40:14 AM »
Hello,

actually i have the Problem i would like to have 2 Scrollviews in one Window.
And only Scroll then 1 Scrollview when im Hoverd over it.
And the other one also when i hoverd over it.

It is a Quest Log Window.

First Scrollview above will be with Buttons where the Questnames should be in to scroll also if you have more Quests.

The second one will then display the The Quest Text and Objective.


Attached a Screenshot to the post.

All is working fine. But only both Scrollviews scroll at the same time when i do it via Mouse Wheel or by hand slider.

Need help there what im doing wrong?

Thx


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2 Scrollviews in 1 Window
« Reply #1 on: December 31, 2014, 03:43:05 PM »
UIDragScrollview script is what handles scroll view movement, scroll wheel included. Whichever UIDragScrollview is under the mouse will determine which scroll view gets scrolled.

UltraTM

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: 2 Scrollviews in 1 Window
« Reply #2 on: January 01, 2015, 05:16:52 AM »
Hi,

i checked that they dont collide each other.
one scrollview is under the next one.
But still both are scrolling.

what do you mean with that?

i have on both containers the UIDragScrollview for each one.
but i cant get it work to hover with the mouse over the down one to only scroll the down one

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2 Scrollviews in 1 Window
« Reply #3 on: January 01, 2015, 07:19:30 PM »
UIDragScrollview script goes on a collider -- any collider inside the scroll view as well as the collider for the bounds of the scroll view (usually an invisible widget -- ALT_SHIFT_W). That's what makes dragging a scroll view and reacting to mouse wheel events possible. If you attach two of those scripts to the same collider, each pointing to a different scroll view, then a single scroll action will affect both at the same time.