OpenLiberty/scripts/menu.gd

20 lines
616 B
GDScript3
Raw Normal View History

2022-11-09 02:21:16 +07:00
extends Control
2022-11-14 01:01:10 +07:00
@onready var container := $VBoxContainer as VBoxContainer
const scenes := {
2024-08-15 19:25:32 -03:00
"Texture viewer": "res://scenes/txd.tscn",
2022-11-14 01:24:32 +07:00
"Flycam test": "res://scenes/flycam/flycam.tscn",
2024-08-15 19:25:32 -03:00
"DFF Test": "res://scenes/model_test.tscn",
"Map loader test": "res://scenes/map_test.tscn", }
2022-11-14 01:01:10 +07:00
func _ready() -> void:
for k in scenes:
var button := Button.new()
button.text = k
button.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
button.size_flags_vertical = Control.SIZE_SHRINK_CENTER
button.pressed.connect(func _load_scene():
2024-08-15 19:25:32 -03:00
get_tree().change_scene_to_file(scenes[k]) )
2022-11-14 01:01:10 +07:00
container.add_child(button)