Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: PompeyBlue on September 05, 2016, 05:23:07 AM

Title: Possible to have a button, when highlighted by a dpad, reacts to dpad up / down
Post by: PompeyBlue on September 05, 2016, 05:23:07 AM
Hello

Basically as the topic states. I have a button which I can navigate to using my dpad. However I want more than simply click. I want, if it's highlighted, to pick up up/down and to call two separate functions based on whether the up/down is called. I guess I could have my own script which checks what is highlighted in NGUI and then checks for joystick up/down and calls relevant functions but was wondering if this functionality is available in NGUI already? It looks similar to sliders.
Title: Re: Possible to have a button, when highlighted by a dpad, reacts to dpad up / down
Post by: ArenMook on September 05, 2016, 08:37:05 AM
Object currently selected by the controller (UICamera.controllerNavigationObject) will receive events, including key events like button presses. In Windward I had buttons react to D-Pad keys for navigation as well by simply using UIKeyNavigation. All you have to do is set the horizontal and vertical axis names on your UICamera to the D-Pad axes.