test-client-godot/scenes/GUI/Settings/MenuButton.gd
2018-07-25 09:36:19 +02:00

13 lines
No EOL
285 B
GDScript

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)