- Home /
How do i do tooltips on UI.Text objects?
I've seen some places, notably custom editors, using the GUIContent class to have text with toioltips on it. But i understand that this system is legacy stuff?
I'm making a menu with UI.Text components, and i'd like to have hovertips to explain what each line means.
how might i go about this, hopefully without making too much change
Answer by KdRWaylander · May 19, 2015 at 08:54 AM
Hi, Here's a homemade way of doing tooltips:
Create a text object, custom it as you want, put it desabled as a child of your text/button/image you want to tooltip
Add two event trigger components on your text/button/image
The first one will be a Pointer Enter and will able the tooltip
The second one will be a Pointer Exit and will disable the tooltip
To set the event triggers, you need to drag and drop the tooltip object in the left field and then in the dropdown menu on the right you choose GameObject, then SetActive (bool) and you tick (or not) the little toggle that appeared :) If you have trouble doing this, just ask !
Your answer
Follow this Question
Related Questions
Why isn't the text preferred size calculating correctly? 0 Answers
Graphic problem with UI Text 2 Answers
New UI: change text 2 Answers
UGUI Find tapped character in textfield? 1 Answer
How to have a texture instead of a color as a background of Text? 0 Answers