Author Topic: How to add a UIToolTip?  (Read 2165 times)

LordYabo

  • Guest
How to add a UIToolTip?
« on: May 31, 2013, 04:05:06 PM »
I'm looking at the NGUI Example X character scene.
I see a tool tip on there, and the camera has references to a tooltip delay, etc.
I see in the documentation UIToolTip as an object.
But my widget tool doesn't show the ability to add a tooltip to my scene.

Am I misunderstanding, is a tooltip something I have to add to my own gameobject?  It's not done through the widget?


StridingDragon

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 53
    • View Profile
Re: How to add a UIToolTip?
« Reply #1 on: May 31, 2013, 04:31:03 PM »
In your Scene create an empty GameObject and attach the UITooltip script to it. Then create a Label as a child under it. Set it up so that the UITooltip script uses that label for the text output by assigning it in the Inspector.

Now all you have to do in your own code is make a call to UITooltip.ShowText( "Here is your own string" ) to display the text.