Author Topic: Button stuck on Hover  (Read 2330 times)

yeahus

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 10
    • View Profile
Button stuck on Hover
« on: April 02, 2015, 06:01:37 AM »
I hate to be really vague, but something has happened to my project that has caused all buttons in one scene (but not all scenes) to get stuck in their hover states until the next input. I've done the usual googling but can't see an easy explanation anywhere - any ideas?

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Button stuck on Hover
« Reply #1 on: April 04, 2015, 03:52:54 AM »
You mean visually? Sounds like you've changed the starting state of some button prefab.

yeahus

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: Button stuck on Hover
« Reply #2 on: April 07, 2015, 05:33:53 AM »
Yeah visually. None of the buttons are prefabs, not sure what you mean?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Button stuck on Hover
« Reply #3 on: April 07, 2015, 09:09:08 AM »
Then I don't understand what you mean by them getting stuck in a hover state. The button script simply changes the color and/or sprite of the referenced UISprite based on the button's state.

yeahus

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: Button stuck on Hover
« Reply #4 on: April 07, 2015, 11:35:35 AM »
I just stuck a quick test script on one of the buttons and it's actually not just visually - it's stuck in the hover state until another button is pressed?

yeahus

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: Button stuck on Hover
« Reply #5 on: April 09, 2015, 05:33:59 AM »
Any ideas @ArenMook? Sorry to be annoying, it's all a bit bizarre!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Button stuck on Hover
« Reply #6 on: April 09, 2015, 03:55:51 PM »
You aren't giving me enough information to go on here.

The only way a button will get "stuck" in a highlighted state in NGUI is if the mouse hovers over it, or if you use keyboard/controller input and the button gets selected.

UIKeyNavigation has the "starts selected" option.