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

13 lines
285 B
GDScript3
Raw Normal View History

2018-07-25 07:36:19 +00:00
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)