You can use a TextureRect instead of a Sprite and connect it's mouse_entered
- and mouse_exited
-signals to show or hide the label respectively:
extends TextureRect
func ready():
connect("mouse_entered", self, "_on_mouse_entered")
connect("mouse_exited", self, "_on_mouse_exited")
func _on_mouse_entered():
$Label.show()
func _on_mouse_exited():
$Label.hide()
The script above assumes that your label-node is a direct child of the TextureRect, if that's not the case you need to adapt the path to the label-node accordingly.