Welcome,
Guest
. Please
login
or
register
.
May 11, 2026, 12:11:27 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Scrolling in multiple axis
« previous
next »
Print
Pages: [
1
]
Author
Topic: Scrolling in multiple axis (Read 3933 times)
sunkas
Guest
Scrolling in multiple axis
«
on:
October 23, 2012, 03:13:44 PM »
Hi
I need to implement a scrollable panel which shall support scrolling in both x and y axis. The problem is that it shall not be possible to scroll in both directions simultaneous. If the user start to scroll down, it shall not be possible to scroll left/right. And the other way around..
What it the best way to achieve this?
Left/right scrolling shall also support "snapping" to the different subscenes the user scrolls between. But that's perhaps a later problem
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Scrolling in multiple axis
«
Reply #1 on:
October 23, 2012, 03:17:51 PM »
Start with the ability to scroll freely along both X and Y, but keep an eye on how far you've dragged in OnDrag. If far enough in some direction, lock dragging in that direction by setting the drag scale value on the opposite axis to 0.
Logged
sunkas
Guest
Re: Scrolling in multiple axis
«
Reply #2 on:
November 02, 2012, 06:22:35 AM »
Thanks! Good solution!
However, I also want to restore the opposite axis position if the axis scrolling switch. What is the best way to programmatically move the content of the scroll panel? When I change the position of the DraggablePanel the clipping also moves...
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Scrolling in multiple axis
«
Reply #3 on:
November 02, 2012, 04:15:57 PM »
Move its clipping in the opposite direction. That's how scrolling works as well.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Scrolling in multiple axis