add fullscreen and quitting managers
This commit is contained in:
14
scripts/globals/fullscreen_manager.gd
Normal file
14
scripts/globals/fullscreen_manager.gd
Normal 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)
|
||||
Reference in New Issue
Block a user