Author Topic: Giving focus to a UIButton  (Read 2430 times)

Seith

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 37
    • View Profile
    • SeithCG
Giving focus to a UIButton
« on: February 19, 2014, 12:37:27 PM »
Hello, I have a couple of buttons that I show and hide as my game UI requires but the problem is I don't know how to give focus to a button after I just activated it. The UI is manipulated via a x360 gamepad and I would like to be able to navigate between the buttons by using the left analog stick up/down.

But as I said I need to highlight ("hover") a specific UIButton so that pressing a button on the gamepad will trigger the OnClick method of said UIButton.
SeithCG.com

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Giving focus to a UIButton
« Reply #1 on: February 19, 2014, 03:44:18 PM »
UICamera.selectedObject = yourButtonGameObject;