Tool Tips

TGUI 0.7 is no longer supported, use a newer TGUI version instead.

Normal tool tip

Tool tips are usually just labels, which is exactly what you get if you create a tool tip with one of the themes shipped with TGUI.

tgui::Label::Ptr toolTip = theme->load("ToolTip");
toolTip->setText("world");
button->setToolTip(toolTip);
Tool Tip Label

Special tool tip

But the tool tip does not has to be a label, it can be any widget. Here I used a Picture but you could also use a Panel and make the tool tip as complex as you want.

tgui::Picture::Ptr toolTip = tgui::Picture::create("image.png");
button->setToolTip(toolTip);
Tool Tip Picture

Properties

There also exists a ToolTip class in which you find static function to change the time before the tool tip shows up and the distance between the mouse and the tool tip. Setting the display time to 0 will cause the tool tip to always be visible when the mouse is on top of the widget.

tgui::ToolTip::setTimeToDisplay(sf::milliseconds(300));
tgui::ToolTip::setDistanceToMouse({4, 8});