How do I achive this behavior, which Godot uses for its own GUI? It is just used for example, don't mind the content of that menu.

I assume that this is a PopupMenu Node but I cannot find any signal which opens this submenu on mouse over input (without clicking to activate that element).

Second question: How to use the add_submenu_item() function from PopupMenu node to add those submenu?

I figured it out for myself. Solution is as follows:

## at first populate the main menu
var mainMenu = PopupMenu.new()
var mainMenu_items = [item_a, item_b]
for i in range(0, mainMenu_items.size()):
	var subMenu_items = [sub_item_a, sub_item_b]
	var subMenu = PopupMenu.new()
	for j in range(0, subMenu_items.size()):
		subMenu.add_item(subMenu_items[j])
	mainMenu.add_child(subMenu) ## it is important to add that node as a child node, otherwise it won't work
	mainMenu.add_submenu_item(mainMenu_items[i], subMenu.get_name())
4 years later