Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: razil_zul on January 22, 2014, 02:42:20 AM

Title: UICenterOnChild not working correctly on first attempt of slide
Post by: razil_zul on January 22, 2014, 02:42:20 AM
UICenterOnChild is not working correctly on first attempt of slide. Even when i set the threshold to 1, the first attempt of sliding in a group of sprites will not change to the next sprite. Only when i retry the swipe the second time onwards than it will work as per normal.

This happens on both editor and also on mobile. I tried it on a new project and same thing happens so quite sure theres a bug on the script.
Title: Re: UICenterOnChild not working correctly on first attempt of slide
Post by: ArenMook on January 22, 2014, 05:15:15 AM
"First attempt of slide"? I'm not sure what you mean.
Title: Re: UICenterOnChild not working correctly on first attempt of slide
Post by: razil_zul on January 22, 2014, 05:18:17 AM
the action of swiping to the next item in the uiscrollview. It feels as though it is not following the threshold set in the UICenterOnChild when you are swiping for the first time so it just reverts back to the first item instead of shifting position to the second item.
Title: Re: UICenterOnChild not working correctly on first attempt of slide
Post by: ArenMook on January 22, 2014, 05:24:14 AM
The logic for it is dead-simple, so I'm not sure how that would be the case. Have a look at UICenterOnChild line 112. The only way I see it not working would be if the UICenterOnChild script is not actually centered on anything yet.
Title: Re: UICenterOnChild not working correctly on first attempt of slide
Post by: razil_zul on January 22, 2014, 08:18:00 PM
yea got it working now! all i needed to do was ensure that the first item was centered by manually calling CenterOn() on the first item of the list and now its working perfectly! Thanks for the help!