Author Topic: UIButtonKeys - Starts Selected  (Read 4150 times)

mmuller

  • Guest
UIButtonKeys - Starts Selected
« on: January 24, 2013, 03:47:29 PM »
Hi,

Another little post. I have all my buttons setup with UIButtonKeys and on loading the game the menu highlights the item set as 'Starts Selected' and works as expected.

When I switch to my settings menu the same occurs, the item in that menu set as 'Starts Selected' appears correctly. However, when exiting that menu back to the game menu the 'Starts Selected' item remains unselected and no other items are selected at all... Should I create a small script to force the starts selected or have you come across this before?

I have tested the controller input demo 4 and this works as expected but doesn't have nearly as many buttons as my menus do - not that this should cause an issue should it?

Any tips would be greatly received. I have even changed my menu switching script to use NGUITools.SetActive rather than GO.SetActive in case that was causing an issue.

Regards,

Mark

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIButtonKeys - Starts Selected
« Reply #1 on: January 24, 2013, 08:15:13 PM »
You need to actually give focus to something. UICamera.selectedObject = something.

richicon

  • Guest
Re: UIButtonKeys - Starts Selected
« Reply #2 on: November 18, 2013, 02:16:18 PM »
How do you do this:

"UICamera.selectedObject = something" ?

I can't see any option to do this, and the controller input example doesn't have anything that appears to do this, unless it happens via the Animation component.

The test buttons in my project do not have animation or tween components, but otherwise appear to match the controller input example exactly, yet try as I might I can't get it to highlight an option when exiting back to a previous menu.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIButtonKeys - Starts Selected
« Reply #3 on: November 19, 2013, 10:08:50 PM »
Wait I think I misunderstood your question.

Going through UIButtonKeys, the objects you specify as "Selected On XXX" are the ones that get selected. So "Selected On Click" is what gets selected when you choose a button with Enter (or the controller).