-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameContainer.gd
43 lines (28 loc) · 942 Bytes
/
GameContainer.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class_name GameContainer
extends CanvasLayer
export var min_win = Vector2(500,500)
onready var def_siz = OS.window_size
var chatbox_node_str = "ElizaChat"
var tracerbox_node_str = "TracerHistory"
func _on_GameContainer_tree_exiting():
autoloadpy.set_chatbox_node("")
autoloadpy.set_tracerbox_node("")
func _ready():
OS.min_window_size = min_win
autoloadpy.set_chatbox_node(chatbox_node_str)
autoloadpy.set_tracerbox_node(tracerbox_node_str)
autoloadpy.send_greeting()
func window_resize_handler():
if not def_siz:
return
var winsz = OS.window_size
var change = Vector2(winsz.x - def_siz.x, winsz.y - def_siz.y)
if abs(change.x):
OS.window_size = Vector2(winsz.x,winsz.x)
else:
OS.window_size = Vector2(winsz.y,winsz.y)
get_tree().call_group("dynamic_text_size", "do_resize_font")
func _on_Quit_pressed():
get_tree().quit(0)
func _on_Home_pressed():
SceneLoader.change_scene("res://Scenes/menu.tscn",1)