How can I add a tooltip for my inventory?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jujumumu

I know you can add a tooltip using the control, but I have a inventory and it has different items. I don’t think it would be practical to add 50 control nodes one for each slot but correct me if I am wrong. I want it so that if you hover over a slot it shows the stats for the item similar to Terraria’s inventory tooltip system. Not sure how to do this.

:bust_in_silhouette: Reply From: aa

Create one control node that holds the tooltip label and have that node read data from the node you’re hovering over.

So have a control node just next to the mouse and when I hover over a item it would tell the control node to change the tooltip?

jujumumu | 2020-01-03 05:19

I assume each GUI item is a node, that you then set properties on like it’s display sprite, it’s information and so on? If so you can just create a mouse_entered() signal on this type of node that sends it’s information over to the tooltip node.

aa | 2020-01-03 06:20

If I would use the mouse entered and exited system I would have a 100 of them since I have 50 slots for the inventory. I actually don’t use a node for each slot. I use a control node for all 50 slots and using gui input.

jujumumu | 2020-01-04 17:42