test-client-godot/gui_scene/GUI/Settings/MenuButton.gd

13 lines
285 B
GDScript3
Raw Normal View History

extends MenuButton
var popup
func _ready():
popup = get_popup()
popup.add_item("item a")
popup.add_item("item b")
popup.add_item("item c")
# popup.connect("item_pressed", self, "_on_item_pressed")
func _on_item_pressed(ID):
self.text = popup.get_item_text(ID)