I'm trying to find an example of how to exactly use the _make_custom_tooltip()
method? Can anyone share what I'm doing wrong?
Documentation:
Godot Documentation _make_custom_tooltip()
-
I currently have something like this:
# This find the correct TextureRect node
onready var num_castles_icon:TextureRect = self.find_node("NumCastlesIcon")
func _ready():
num_castles_icon._make_custom_tooltip("Total Castles")
func _make_custom_tooltip(text:String)->Control:
# This exists, and is a Control node, with a panel-container and label inside of it
var tooltip = preload("res://scenes/ui/ToolTip.tscn").instance()
tooltip.get_node("Label").text = text
return tooltip
The error I get is:
Invalid call. Nonexistent fuction '_make_custom_tooltip' in base 'TextureRect'.
-
What's weird is that a TextureRect does have a hint_tooltip
, so I figure I could override the default tooltip with my own as per the documentation.
Any help or direction of where to look further would be much appreciated.