Author Topic: Possible to have a button, when highlighted by a dpad, reacts to dpad up / down  (Read 4228 times)

PompeyBlue

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 8
    • View Profile
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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
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.