From 9870e03e811127dfc711919d78d1a144fb8c0db8 Mon Sep 17 00:00:00 2001 From: Nathan Lovato Date: Tue, 11 Feb 2020 12:51:21 -0600 Subject: [PATCH] Add F11 to toggle fullscreen Part of #21 --- project/demos/Demos.gd | 6 ++++++ project/project.godot | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/project/demos/Demos.gd b/project/demos/Demos.gd index 8629712..d8d8f89 100644 --- a/project/demos/Demos.gd +++ b/project/demos/Demos.gd @@ -11,6 +11,12 @@ func _ready() -> void: button_go_back.connect("pressed", self, "_on_ButtonGoBack_pressed") +func _input(event: InputEvent) -> void: + if event.is_action_pressed("toggle_fullscreen"): + OS.window_fullscreen = not OS.window_fullscreen + get_tree().set_input_as_handled() + + func _on_DemoPickerUI_demo_requested() -> void: demo_player.load_demo(demo_picker.demo_path) demo_picker.hide() diff --git a/project/project.godot b/project/project.godot index 96c999c..72b4632 100644 --- a/project/project.godot +++ b/project/project.godot @@ -200,6 +200,8 @@ config/icon="res://icon.png" [display] +window/size/width=1920 +window/size/height=1080 window/size/always_on_top=true [input] @@ -228,6 +230,11 @@ sf_down={ , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null) ] } +toggle_fullscreen={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777254,"unicode":0,"echo":false,"script":null) + ] +} [rendering]