How to change the position of popup menu in MenuButton?

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

They always pop up below (or above) the button, and I want to try to change it to appear on the left, right, or fixed position of the button (such as the center of the screen).
I can use the GetPopup() method to get the button’s subitem popup menu, but changing its position doesn’t work.

:bust_in_silhouette: Reply From: jgodfrey

This seems to work for me…

func _on_menu_button_pressed():
	var popup = $MenuButton.get_popup()
	popup.position = Vector2i(100,100)

(wired to the menu button’s pressed event). That same code does not, however, work from the _ready() function - which is what I tried first. Presumably, because the auto-calculated position is set at some point during the interaction phase…