add fullscreen and quitting managers

This commit is contained in:
2024-10-05 19:40:28 +10:00
parent 174e28d2c2
commit e59b67bd14
3 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
extends Node
var is_fullscreen: bool = false
func _input(event: InputEvent) -> void:
if event.is_action_pressed("toggle_fullscreen"):
toggle_fullscreen()
func toggle_fullscreen() -> void:
is_fullscreen = !is_fullscreen
if is_fullscreen:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
else:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)