Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: tr1stan on August 28, 2014, 02:42:43 AM

Title: Key Navigation on Scroll View
Post by: tr1stan on August 28, 2014, 02:42:43 AM
Hey guys,

What's the proper strategy to use Key navigation if I'm dealing with scroll view? I have a list of buttons which is dynamically generated at runtime under that scroll view, how can I navigate through those individual buttons with keyboard?

Title: Re: Key Navigation on Scroll View
Post by: ArenMook on August 28, 2014, 09:03:25 PM
Button navigation is simple enough with UIKeyNavigation, but I'm assuming you want to scroll the scroll view as well. Knowing the UICamera.selectedObject you can calculate its position and check -- UIPanel.IsVisible? If not, center the scroll view on that position (easiest, SpringPanel.Begin) or move it in that direction (a bit more difficult).