2024-01-14 11:22:14 +00:00
|
|
|
extends Node
|
|
|
|
|
|
|
|
func _ready():
|
|
|
|
# Capture mouse
|
|
|
|
#Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
|
|
|
|
|
|
|
# Mute audio
|
|
|
|
var master_sound = AudioServer.get_bus_index("Master")
|
|
|
|
AudioServer.set_bus_mute(master_sound, true)
|
|
|
|
|
|
|
|
func _input(event):
|
|
|
|
if event.is_action_pressed("toggle_fullscreen"):
|
2024-01-15 23:22:14 +00:00
|
|
|
toggle_fullscreen()
|
2024-01-14 11:22:14 +00:00
|
|
|
|
2024-01-15 23:22:14 +00:00
|
|
|
func toggle_fullscreen():
|
|
|
|
var mode = DisplayServer.window_get_mode()
|
2024-01-14 11:22:14 +00:00
|
|
|
|
2024-01-15 23:22:14 +00:00
|
|
|
match mode:
|
|
|
|
DisplayServer.WINDOW_MODE_FULLSCREEN:
|
|
|
|
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
|
|
|
|
_:
|
|
|
|
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
|
|
|
|
|
|
|
|
return
|