Popupmenu items and on_mouse_entered

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

I have buttonmenu node with actions on button pressed:

func _on_PopupMenu_index_pressed(index):
	match (index):
		0:
			action1
		1:
			action2
		2:
			action3

And I need signal(?) for actions(items) description on mouse hover with the same structure. Something like this:

func _on_PopupMenu_index_Mouse_entered(index)
    match (index):
        0:
            label.text = "love +5"
        1:
            label.text = "love +10"

But I can’t find code to do so. Is there any way to code “mouse_entered” for Popupmenu items?

:bust_in_silhouette: Reply From: glihm

Hello,

PopupMenu inherits from Control, so you should be able to connect the signal mouse_entered() without any problem for the popup itself.

About the menu items, what are you adding as children into the PopupMenu? If the children inherit from Control, you should be able to connect their mouse_entered() signal.

I’m adding items with “Item list editor”(for PopupMenu) and there’s no mouse_entered() signal for those elements in inspector. They are not nodes

Rokatansky | 2021-03-03 20:26