Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: richardwood on August 29, 2014, 02:15:45 PM

Title: How do you use tooltip?
Post by: richardwood on August 29, 2014, 02:15:45 PM
Hey, is there a short tutorial on how to implement tooltip?
I've been tinkering around and confused. I want a tooltip appear when users hover to sprite and not moving cursor. So I put this on the sprite

  1. public void OnTooltip()
  2.     {
  3.         Debug.Log("triggered");
  4.     }

it does nothing.
need help Thanks!
Title: Re: How do you use tooltip?
Post by: Yukichu on August 29, 2014, 06:14:55 PM
You have to roll your own for more options, but the basics are:

  1.     void OnTooltip(bool show)
  2.     {
  3.         if (show)
  4.         {
  5.             ShowText("Some text");
  6.         }
  7.         else
  8.         {
  9.             ShowText("");
  10.         }
  11.     }

Setting the value to empty string or null makes the tooltip go away.
Title: Re: How do you use tooltip?
Post by: richardwood on August 30, 2014, 01:47:06 AM
Thank you, that solved it  :)