gmtk-2024/scripts/global.gd

18 lines
495 B
GDScript3
Raw Permalink Normal View History

2024-08-17 15:49:40 +00:00
extends Node
var previous_window_mode = -1
func _process(delta: float) -> void:
2024-08-17 21:39:51 +00:00
# keybinds
2024-08-17 15:49:40 +00:00
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()