godot-steering-ai-framework/project/demos/DemoPickerUI.gd
Nathan Lovato 6132a0aa25 Refactor the demos to support screen resizing
Add BackgroudLayer and DemoInterface scenes that we can reuse across demos
Set the game to 2D and extend window modes

Part of #21
2020-02-08 15:40:43 -06:00

22 lines
527 B
GDScript

class_name DemoPickerUI
extends Control
signal demo_requested
var demo_path := "" setget set_demo_path
onready var list: ItemList = $VBoxContainer/ItemList
onready var button: Button = $VBoxContainer/Button
func _ready() -> void:
list.connect("demo_selected", self, "set_demo_path")
list.connect("item_activated", self, "emit_signal", ["demo_requested"])
button.connect("pressed", self, "emit_signal", ["demo_requested"])
demo_path = list.file_paths[0]
func set_demo_path(value: String) -> void:
demo_path = value