Skip to content

Tooltips ​

A tooltip is the small window that appears when the player points at something: an item, an ability, a buff, a node of a skill tree, a button. The toolkit has six tooltips, one for each kind of thing it describes. They are made once, when the game starts, and one of each is reused for every request.

TooltipRoot classShown forTemplate (in ui_scenes/in_game/tooltips/)
ItemTooltipItemAn item in a bag, the equipment, a shop, a loot windowitems/tooltip_item_template.tscn
AbilityTooltipAbilityAn ability in the spellbook, on the action bar, in a trainer's listabilites/tooltip_ability_template.tscn
EffectTooltipEffectA buff or a debuff icontooltip_effect_template.tscn
Skill nodeTooltipSkillNodeA node of a skill tree (and the choices of a choice node)tooltip_skill_node_template.tscn
DescriptionTooltipDescriptionAnything with a name and a text: the buttons of the mini menu, a stattooltip_description_template.tscn
EntityTooltipEntityAn NPC, a pet, a party member or an object under the pointertooltip_entity_template.tscn

They are set in UI Settings. All five extend TooltipBase, which brings the common look and the placement.

The entity tooltip ​

Pointing at an NPC, a pet, a party member or an object (its body or its nameplate) shows the entity tooltip. It is deliberately short:

LineWhere it comes from
NameThe name of the entity, in the color of a tag that asks for it
TagsThe entity tags it has that want to be listed (Show the tag in the tooltip), the highest priority first, in the color of the first
TypeIts entity types (Humanoid, Undead). Hidden when it has none
LevelLevel 12. Hidden for an object
FactionThe name of its faction. Hidden for the environmental faction
StandingWhat the player is to that faction: the name of the reputation level when the faction has levels (Honored), otherwise Friendly, Neutral or Hostile. In the color the nameplates use for that relation
DescriptionThe Description written on the NPC or object definition
QuestsThe active quest objectives that are about it: the NPC to defeat or talk to, the chest to open, the gathering node. Each line is the quest, the objective and its progress (Hunt for glory: Defeat 3 Wolves (1/3)). Hidden when none is

An entity tag can also put art at the top of the tooltip (Tooltip art), for a boss crest or a banner.

Every part is optional. The tooltip looks for each node by its unique name and fills it only if the node is in the scene. To get a tooltip with the parts you want, add or remove nodes in your own copy of tooltip_entity_template.tscn:

Unique nameTypeShows
%EntityNameLabelLabelThe name
%TagsLabelLabelThe listed entity tags
%EntityTypeLabelLabelThe entity types
%LevelLabelLabelThe level
%FactionLabelLabelThe faction
%StandingLabelLabelThe standing of the player
%DescriptionLabelLabelThe description
%TagArtTextureRectThe art of the tag
%ObjectivesContainerany ControlThe part that holds the quest lines. Hidden when no objective is about the target
%ObjectivesLabelLabelThe quest lines

A part with nothing to show is hidden. A node that is not in the scene is never touched.

The tooltip is set in UI Settings (Entity tooltip). Leave the setting empty and no tooltip is shown for entities. To show it from your own part of the interface, emit entity_tooltip_requested(target) and hide_tooltip(false) like the others; the in-game interface already does it when the pointer goes over an entity or an object.

How a tooltip is requested ​

Nothing in the interface shows a tooltip directly. A part (a slot, a button, an icon) emits a signal, and the signal travels up to the UI manager, which tells the right tooltip to show:

text
an item slot ─ item_tooltip_requested(item, definition, context, extra) ─► the in-game UI ─► the UI manager ─► the item tooltip

Every HUD element and every panel has these signals already, so a part you make only has to emit them:

SignalArguments
item_tooltip_requestedthe item instance, its definition, a context, extra data
ability_tooltip_requestedthe ability
effect_tooltip_requestedthe effect
skill_node_tooltip_requestedthe skill node
description_tooltip_requesteda name, a text
entity_tooltip_requestedan entity or an object
hide_tooltipforce_hide

hide_tooltip hides all of them. Emit it when the mouse leaves.

The item tooltip's context ​

The item tooltip changes what it shows by the context it is asked for:

ContextShows
inventoryThe value of the item
vendor_buyingWhat the player pays
vendor_sellingWhat the vendor pays the player

An item instance shows full detail (the rolled affixes of a generated item, durability, charges, the sockets that are filled, the set pieces that are worn); an item definition alone (a shop's stock, a recipe's result) shows the basics.

Placement ​

A tooltip is a MarginContainer drawn above the rest of the interface, kept at least a few pixels inside the screen. Each tooltip scene has its own placement, set on the root node of the scene (the Placement group):

ExportWhat it doesDefault
PlacementMouse: next to the mouse pointer, with its bottom right corner on it. Fixed: at a place of the screen of your choice, whatever the mouse doesMouse
Fixed cornerFor a fixed tooltip: the corner of the screen it is placed from (top left, top right, bottom left, bottom right, center). The same corner of the tooltip is put on that point, so it grows away from the cornerBottom right
Fixed offsetFor a fixed tooltip: the distance from that corner in pixels, towards the inside of the screen. From the center: right and down16, 16

For example, to show the item tooltip in a box in the top right corner of the screen like a character sheet: open tooltip_item_template.tscn, set Placement to Fixed, Fixed corner to Top right and Fixed offset to 20, 80. Each tooltip can differ: the item tooltip fixed, the ability tooltip on the mouse.

Styling ​

The tooltips share the label settings of TooltipBase, set on the root node of each scene:

OptionWhat it sets
Font, Font sizeThe text of every label (except the item name)
Outline size and colorThe outline
Shadow size, color and offsetThe shadow

Beyond that, the look (backgrounds, borders, spacing) is plain scenes: restyle them as you like.

Making your own ​

For each tooltip scene, keep the root class and the unique names its script reads (open the script to see them: each is a short @onready list at the top). You can add anything else. For example, to add a line to the ability tooltip, add a Label to the scene and fill it in a subclass: class_name MyTooltipAbility extends TooltipAbility, override set_tooltip_data.

Set the new scene in UI Settings. The settings editor checks that the root of each is the right class.

See also ​