Author Topic: Some question about the scrollview !  (Read 3478 times)

xiaoniaojjj

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Some question about the scrollview !
« 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!
« Last Edit: January 21, 2014, 10:04:22 PM by xiaoniaojjj »

xiaoniaojjj

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Re: Some question about the scrollview !
« Reply #1 on: January 20, 2014, 10:11:19 PM »
Help me!!!!!!!!!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Some question about the scrollview !
« Reply #2 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.

xiaoniaojjj

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Re: Some question about the scrollview !
« Reply #3 on: January 21, 2014, 06:42:35 AM »
Thanks for the reply,  Maybe the picture can help you to understand me  about second question!

xiaoniaojjj

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Re: Some question about the scrollview !
« Reply #4 on: January 21, 2014, 09:58:52 AM »
Help me!!!!

Cripple

  • TNP Alpha
  • Full Member
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 117
    • View Profile
Re: Some question about the scrollview !
« Reply #5 on: January 21, 2014, 10:33:49 AM »
Help him!!!! PLEASE ARENMOOK DO IT
Graphicstream Dev.

xiaoniaojjj

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Re: Some question about the scrollview !
« Reply #6 on: January 21, 2014, 10:04:38 PM »
Help me!!!!!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Some question about the scrollview !
« Reply #7 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.