Component: Show Tooltip

Add TutorialShowTooltip to any object with raycasting support to show a tooltip for it.

This component implements multiple IPointer*Handler interfaces to react to pointer events. You can select to display the tooltip when the object is hovered, or clicked, or even long clicked, which is useful in the case of handheld devices.

The content of the tooltip can be specified in 3 modes:

  • Text: Specify the text to display in the tooltip.
  • GameObject: Specify a GameObject to display in the tooltip. The GameObject must reside in the scene already and it will be reparented. This mode is used rarely.
  • Prefab: Specify a prefab to instantiate and display in the tooltip.

This component features modification pipelines for the bounds and for the text.
The initial bounds determined by this component is basically the bounds of the object hosting this component, or that of BoundsObject if specified. The bounds are typically modified later by the tooltip component to the side of the object for instance as how we usually see in common software applications.

Property Description
Tooltip Reference to the tooltip component
BoundsObject Optional reference to a GameObject used as a reference for bounds. If unspecified, the GameObject hosting the Show Tooltip component will be used.
Triggers Specify the triggers that should control the tooltip. You can select the flags from PointerEnter, PointerExit, Click, and Long Click.
SetOnUpdate Whether or not to update the tooltip every frame. This is recommended for tooltips since sometimes the size of the content is determined over the next frame.
ContentMode One of Text, Object, or Prefab
Text Text to display in the tooltip
Object GameObject to display in the tooltip. It could be either on the scene or a prefab.
RecyclePrefab If set, the instantiated prefab will be kept to be recycled and reused.
SettingsOverride Use this property to override the default tooltip settings.
BoundsModifiers Optional modifiers for the bounds. This pipeline is executed first, then the pipeline of the tooltip component calculates the final bounds of the tooltip.
StringModifiers Optional modifiers for the text.