27 lines
772 B
GDScript3
27 lines
772 B
GDScript3
|
extends Node
|
||
|
|
||
|
# class member variables go here, for example:
|
||
|
# var a = 2
|
||
|
# var b = "textvar"
|
||
|
|
||
|
const WINDOW_TITLE_INPUT = "GUI/Settings/Menus/TabContainer/Test/ScrollContainer/VBoxContainer/TitleBox/Title"
|
||
|
|
||
|
func _ready():
|
||
|
change_title()
|
||
|
get_tree().get_root().connect("size_changed", self, "on_window_size_changed")
|
||
|
|
||
|
$GUI.pause()
|
||
|
|
||
|
func _process(delta):
|
||
|
pass
|
||
|
|
||
|
func on_window_size_changed():
|
||
|
change_title()
|
||
|
|
||
|
func change_title():
|
||
|
var title_node = get_node( WINDOW_TITLE_INPUT )
|
||
|
var title = "Khanat"
|
||
|
if title_node and not title_node.text.strip_edges() == "":
|
||
|
title = title_node.text.strip_edges()
|
||
|
title += " (" + String(OS.get_window_size().x) + "x" + String(OS.get_window_size().y) + ")"
|
||
|
OS.set_window_title( title )
|