Author Topic: UIImageButton Disabled state in 2.6.0  (Read 12561 times)

maoguo.zhang

  • Guest
Re: UIImageButton Disabled state in 2.6.0
« Reply #15 on: May 07, 2013, 08:44:29 PM »
Try this one.

I've tested. It's Ok! Thanks!

Klegran

  • Guest
Re: UIImageButton Disabled state in 2.6.0
« Reply #16 on: May 12, 2013, 07:01:48 PM »
To chime in here, there is a bug where after a click, if the button is set to disabled during the click, if the mouse is moved out of the button it will trigger the on hover event and make the button perpetually stuck on "normal" sprite.

The code:
  1. void OnHover (bool isOver)
  2.     {
  3.         if (enabled && target != null)
  4.         {
  5.             target.spriteName = isOver ? hoverSprite : normalSprite;
  6.             target.MakePixelPerfect();
  7.         }
  8.     }

Should be:
  1. void OnHover (bool isOver)
  2.     {
  3.         if (isEnabled && target != null)
  4.         {
  5.             target.spriteName = isOver ? hoverSprite : normalSprite;
  6.             target.MakePixelPerfect();
  7.         }
  8.     }

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIImageButton Disabled state in 2.6.0
« Reply #17 on: May 13, 2013, 01:22:49 AM »
Thanks!