Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: e-tip on May 06, 2015, 10:53:33 AM
-
Hi everyone.
I've got a UIScrollview and in that scrollview i want to implement a pull to refresh function.
i've added the onDragStart and onDragFinish Event to my script but i can't find a way to calculate/obtain the offset when the user ends to drag. Does anyone have any suggestions ?
my goal is to introduce a threshold so reload function is called only when the offset is bigger than threshold
thanks in advance
-
Have a look at UIPanel.CalculateConstrainOffset function. It does exactly what you're looking for.
-
Wow... Thanks
-
Hi,
Can you explain this further how this function can be used to implement pull to refresh.
Thanks in Advance.
-
That function will give you (0, 0) if you are observing your panel normally, and something other than 0 if you have scrolled outside the bounds. Just try using it.