Welcome,
Guest
. Please
login
or
register
.
October 11, 2024, 08:18:10 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Scroll View List-View effect
« previous
next »
Print
Pages: [
1
]
Author
Topic: Scroll View List-View effect (Read 2702 times)
aammfe
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 22
Scroll View List-View effect
«
on:
October 26, 2016, 08:31:30 AM »
Hi!
Scroll view have one child size(100,100) .
when scroll this child to bottom it remain in bottom and do not go to top again.
i have attach an animation , it have two examples first , NGUI , and second is UGUI , and UGUI is working as it is , as supposed to , (changed pivot.y = 1).
how to do it in NGUI.
https://we.tl/fV0LBUQlHa
Logged
artfabrique
Newbie
Thank You
-Given: 5
-Receive: 0
Posts: 45
Re: Scroll View List-View effect
«
Reply #1 on:
October 28, 2016, 06:00:53 AM »
There is an option called "cancel drag if it fits"
I think that is what you need.
Logged
aammfe
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 22
Re: Scroll View List-View effect
«
Reply #2 on:
October 28, 2016, 06:53:38 AM »
i have attached other script , for scrolling events , link pull up , and pull down , etc ,
if
"Cancel Drag if Fits = true"
it stop scrolling means , use could not pull down , etc
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Scroll View List-View effect
«
Reply #3 on:
October 30, 2016, 12:25:07 PM »
Cancel drag if fits will prevent dragging of the scroll view if the contents don't get clipped by its dimensions. Are you trying to make it spring back to top when you release the drag? If so, check the UICenterOnClick script. It shows the short amount of code you need to move the scroll view to a position of your choice. So if you wanted it to move back up to top when you release the touch, subscribe to UIScrollView.onDragFinished, and inside call SpringPanel.Begin with where you want it to move to.
Logged
aammfe
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 22
Re: Scroll View List-View effect
«
Reply #4 on:
October 30, 2016, 03:50:56 PM »
UICenterOnClick
UIScrollView sv = panel.GetComponent<UIScrollView>();
Vector3 offset = -panel.cachedTransform.InverseTransformPoint(transform.position);
if (!sv.canMoveHorizontally) offset.x = panel.cachedTransform.localPosition.x;
if (!sv.canMoveVertically) offset.y = panel.cachedTransform.localPosition.y;
SpringPanel.Begin(panel.cachedGameObject, offset, 6f);
i could not figure out how i will use it in my case , ..?
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Scroll View List-View effect
«
Reply #5 on:
November 03, 2016, 08:03:37 AM »
SpringPanel.Begin lets you spring the panel to the target position. Calculate the position you want, then SpringPanel.Begin to navigate there. As I said, you will want to subscribe to the onDragFinished, and do it there.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Scroll View List-View effect