Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: cygnus on March 19, 2014, 05:46:54 AM
-
Hi all,
I'm having trouble making a grid controllable by a gamepad. I'm using NGUI 3.4.7 and the example scene is working and so I adapted by project to match the example but no luck.
After debugging I noticed the UICamera.selectedObject is always NULL even if the statement before this check I assign the selectedObject with the first in the list (having startSelected = true).
I also noticed the gamepads down and up keys (vertical grid) are properly captured in the UIButtonKeys assigned to all my items within the grid. Bedore you ask: the selectOnUp and selectOnDown properties for all items are properly assigned.
Did I miss something?
-
Upgraded the project to the latest NGUI 3.5.4 r2 but the issue still exists. Somebody any clue what's missing?
-
Ok, works if I assign a scripts that centers the selected object in the scrollview. Is there a way to have a 'normal' scrolling (only scroll when on the bottom or top of the list) iso always centering on the selected item?
-
Via a custom script that will check the position of the selected object versus the scroll view's rectangle.
Btw, to scroll the scroll view, the easiest thing to do would be to detect specific joystick/controller keys in Update, and using SendMessage("OnScroll", delta * Time.deltaTime) to the scroll view.