Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: xiaoniaojjj on January 20, 2014, 08:56:26 AM

Title: Some question about the scrollview !
Post by: xiaoniaojjj on January 20, 2014, 08:56:26 AM
1. How to know whether the scrollview is reached the  left or right border when move finished?
2. How to do the UILeftOnChild like UICenterOnChild?

Maybe the picture can help you understand me!
Title: Re: Some question about the scrollview !
Post by: xiaoniaojjj on January 20, 2014, 10:11:19 PM
Help me!!!!!!!!!
Title: Re: Some question about the scrollview !
Post by: ArenMook on January 21, 2014, 01:08:17 AM
1. Just math. Look at how UIPanel.ConstrainTargetToBounds works.
2. I don't know what UILeftOnChild is or what you intend it to be, but my guess is watch UICenterOnChild.centeredObject. When it changes, do your thing.
Title: Re: Some question about the scrollview !
Post by: xiaoniaojjj on January 21, 2014, 06:42:35 AM
Thanks for the reply,  Maybe the picture can help you to understand me  about second question!
Title: Re: Some question about the scrollview !
Post by: xiaoniaojjj on January 21, 2014, 09:58:52 AM
Help me!!!!
Title: Re: Some question about the scrollview !
Post by: Cripple on January 21, 2014, 10:33:49 AM
Help him!!!! PLEASE ARENMOOK DO IT
Title: Re: Some question about the scrollview !
Post by: xiaoniaojjj on January 21, 2014, 10:04:38 PM
Help me!!!!!
Title: Re: Some question about the scrollview !
Post by: ArenMook on January 22, 2014, 02:07:29 AM
Posting "help me!!!" does nothing. I see all posts that I haven't answered, and do it in order when I do my daily support run.

To do what you're trying to do, you need to write your own logic. UICenterOnChild centers on a child, as simple as that. If you want there to be code that prevents going to the last child, and instead diverts to the second last, then modify UICenterOnChild/UICenterOnClick script to do just that.

NGUI's source code is yours to modify for a reason.