-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSettings.cs
More file actions
34 lines (32 loc) · 891 Bytes
/
Settings.cs
File metadata and controls
34 lines (32 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using Godot;
using System;
public class Settings : Node
{
private bool _fullscreen;
private readonly Vector2 _windowSize = new Vector2(960, 540);
private readonly Vector2 _fullscreenSize = new Vector2(1920, 1080);
public override void _Input(InputEvent @event)
{
if (@event.IsActionPressed("fullscreen"))
{
if (!_fullscreen)
{
OS.WindowBorderless = true;
OS.WindowSize = _fullscreenSize;
OS.CenterWindow();
_fullscreen = true;
}
else
{
OS.WindowBorderless = false;
OS.WindowSize = _windowSize;
OS.CenterWindow();
_fullscreen = false;
}
}
else if (@event.IsActionPressed("quit"))
{
GetTree().Quit();
}
}
}