-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainScene.gd
More file actions
30 lines (25 loc) · 1.25 KB
/
Copy pathMainScene.gd
File metadata and controls
30 lines (25 loc) · 1.25 KB
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
extends Node2D
func screen_metrics():
print(" [Screen Metrics]")
print(" Display size: ", OS.get_screen_size())
print(" Decorated Window size: ", OS.get_real_window_size())
print(" Window size: ", OS.get_window_size())
print(" Project Settings: Width=", ProjectSettings.get_setting("display/window/size/width"), " Height=", ProjectSettings.get_setting("display/window/size/height"))
print(OS.get_window_size().x)
print(OS.get_window_size().y)
func resize_screen():
OS.set_window_size(Vector2(320, 370))
func register_buttons():
$ButtonsArea/ButtonBlue.connect("pressed", Globals.GameLogic, "play_turn", [Globals.BLUE_COLOR])
$ButtonsArea/ButtonGreen.connect("pressed", Globals.GameLogic, "play_turn", [Globals.GREEN_COLOR])
$ButtonsArea/ButtonRed.connect("pressed", Globals.GameLogic, "play_turn", [Globals.RED_COLOR])
$ButtonsArea/ButtonYellow.connect("pressed", Globals.GameLogic, "play_turn", [Globals.YELLOW_COLOR])
$ButtonNewGame.connect("pressed", Globals.GameLogic, "init_new_game")
func _ready():
# get_tree().root.connect("size_changed", self, "screen_metrics")
resize_screen()
$StatusText.UpdateMoves()
register_buttons()
Globals.GameLogic.init_new_game()
func _init():
Globals.MainScene = self