gmtk-2024/scripts/global.gd
2024-08-17 22:39:51 +01:00

17 lines
495 B
GDScript

extends Node
var previous_window_mode = -1
func _process(delta: float) -> void:
# keybinds
if Input.is_action_just_pressed("toggle_fullscreen"):
if get_window().mode == Window.MODE_FULLSCREEN:
if previous_window_mode != -1:
get_window().mode = previous_window_mode
else:
get_window().mode = Window.MODE_MAXIMIZED
else:
previous_window_mode = get_window().mode
get_window().mode = Window.MODE_FULLSCREEN
elif Input.is_action_just_pressed("quit"):
get_tree().quit()