Control._makeCustomTooltip

Virtual method to be implemented by the user. Returns a Control node that should be used as a tooltip instead of the default one. The for_text includes the contents of the hintTooltip property. The returned node must be of type Control or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance). When null or a non-Control node is returned, the default tooltip will be used instead. The returned node will be added as child to a PopupPanel, so you should only provide the contents of that panel. That PopupPanel can be themed using Theme.setStylebox for the type "TooltipPanel" (see hintTooltip for an example). Note: The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its rectMinSize to some non-zero value. Example of usage with a custom-constructed node:

More...
struct Control
@nogc nothrow
_makeCustomTooltip
(
in String for_text
)

Detailed Description

func _make_custom_tooltip(for_text): var label = Label.new() label.text = for_text return label

Example of usage with a custom scene instance:

func _make_custom_tooltip(for_text): var tooltip = preload("res://SomeTooltipScene.tscn").instance() tooltip.get_node("Label").text = for_text return tooltip

Meta