Skip to content

Development: Tooltips

Sorra edited this page Nov 11, 2024 · 4 revisions

To add tooltips to a UI element follow these steps:

  • Ensure there is a RW_TooltipManager in the scene
  • Create a Tooltip Style prefab that defines the style of the tooltip and any dynamic fields image image
  • Add a Tooltip Trigger component to the element you want a tooltip on
    • Tooltip Style: The one created above
    • Body Text: as needed
    • Tip Position: MouseBottomRightCorner
    • Min Text Width: 200
    • Max Text Width: 300

image

Auto-Updating Body Text

You can automatically update fields based on text fields in the UI.

  • Add an AutoUpdateTooltipFields component
  • Add IDs for the fields
  • Add text or TextMeshPro fields with the content to place in these fields
  • Add fields to the body text of the Tooltip Trigger component
  • Set the content of the dynamic fields in the Tooltip Trigger to `Dummy Text

Clone this wiki locally