Tooltips

Tooltip Actions (uGUI & TMP)

Action Name

Description

Show Tooltip

Show a Tooltip on a UI element.

Hide Tooltip

Hide a Tooltip on a UI element.

The Tooltip Actions are similar for uGUI text and TextMeshPro Text. However, they are different in the fact that the TMP Actions display TextMeshPro text and the uGUI do not. To use the TMP Tooltips, you must include the TextMeshPro package from the Unity Package Manager.

To add tooltips to a UI Element, complete the following steps. For this example we will us a GC Button.

  1. Locate the Tooltip Prefab and drag it into your Scene.

2. Add a GC Button to your Canvas Panel and add two separate Actions. We have called them Show Tooltip and Hide Tooltip for clarity.

3. In the Show Action, add the Canvas panel to the Target slot, the Tooltip prefab to the Panel slot, and set the other settings as required. The Offset from Target dictates where the tooltip will be displayed. You can also add an Audio clip, and this will override the Time Showing setting.

4. In the Hide Tooltip Action, drag the Show Action(from 3 above) into the Hide slot. This Action will hide the tooltip when the mouse is moved off the element, regardless of the Time Showing setting.

5. On the Button element, we need to add two GC Triggers. The first one should be set to "On Mouse Enter UI" and execute the Show Tooltip Action, and the second one should be set to "On Mouse Exit UI" and execute the Hide Tooltip Action.

6. In the Add Actions, we have added a New Game Action for the example, but if the elements is an Image or something else, this field is not present.

See the UI Example for Simple Menu with Tooltips included in this Asset Package for more detail on using Tooltips.

Last updated