Function 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. Use for_text
parameter to determine what text the tooltip should contain (likely the contents of hintTooltip
).
The returned node must be of type Control
or Control-derieved. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance, not e.g. a node from scene. When null
or non-Control node is returned, the default tooltip will be used instead.
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 custom-constructed node:
func make_custom_tooltip(for_text): var label = Label.new() label.text = for_text return label
Example of usage with custom scene instance:
func make_custom_tooltip(for_text): var tooltip = preload("SomeTooltipScene.tscn").instance() tooltip.get_node("Label").text = for_text return tooltip