summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Sizov <11782833+YuriSizov@users.noreply.github.com>2022-08-18 23:43:01 +0300
committerGitHub <noreply@github.com>2022-08-18 23:43:01 +0300
commit72e25f794c0b454ce9547167e9e7989ac392239c (patch)
tree559159660ff1ed38ac7f7b301c51347395055c10
parent1811a4d78491c970f0d1c4ba424f681bd3bfa21c (diff)
parente559dcb8f53defbd24d206042cc38f934f58e4c3 (diff)
Merge pull request #55032 from Calinou/tweak-default-window-size
Increase the default project window size for better usability
-rw-r--r--core/config/project_settings.cpp8
-rw-r--r--doc/classes/ProjectSettings.xml16
-rw-r--r--main/main.cpp2
3 files changed, 15 insertions, 11 deletions
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp
index 5c4bcc687a..ec74d7ea28 100644
--- a/core/config/project_settings.cpp
+++ b/core/config/project_settings.cpp
@@ -1183,10 +1183,14 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF("application/config/custom_user_dir_name", "");
GLOBAL_DEF("application/config/project_settings_override", "");
- GLOBAL_DEF_BASIC("display/window/size/viewport_width", 1024);
+ // The default window size is tuned to:
+ // - Have a 16:9 aspect ratio,
+ // - Have both dimensions divisible by 8 to better play along with video recording,
+ // - Be displayable correctly in windowed mode on a 1366×768 display (tested on Windows 10 with default settings).
+ GLOBAL_DEF_BASIC("display/window/size/viewport_width", 1152);
custom_prop_info["display/window/size/viewport_width"] = PropertyInfo(Variant::INT, "display/window/size/viewport_width", PROPERTY_HINT_RANGE, "0,7680,1,or_greater"); // 8K resolution
- GLOBAL_DEF_BASIC("display/window/size/viewport_height", 600);
+ GLOBAL_DEF_BASIC("display/window/size/viewport_height", 648);
custom_prop_info["display/window/size/viewport_height"] = PropertyInfo(Variant::INT, "display/window/size/viewport_height", PROPERTY_HINT_RANGE, "0,4320,1,or_greater"); // 8K resolution
GLOBAL_DEF_BASIC("display/window/size/resizable", true);
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 680ddf341e..fcde9f6686 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -578,19 +578,19 @@
Allows the window to be resizable by default.
[b]Note:[/b] This setting is ignored on iOS.
</member>
- <member name="display/window/size/viewport_height" type="int" setter="" getter="" default="600">
- Sets the game's main viewport height. On desktop platforms, this is also the initial window height.
+ <member name="display/window/size/viewport_height" type="int" setter="" getter="" default="648">
+ Sets the game's main viewport height. On desktop platforms, this is also the initial window height, represented by an indigo-colored rectangle in the 2D editor. Stretch mode settings also use this as a reference when using the [code]canvas_items[/code] or [code]viewport[/code] stretch modes. See also [member display/window/size/viewport_width], [member display/window/size/window_width_override] and [member display/window/size/window_height_override].
</member>
- <member name="display/window/size/viewport_width" type="int" setter="" getter="" default="1024">
- Sets the game's main viewport width. On desktop platforms, this is also the initial window width.
+ <member name="display/window/size/viewport_width" type="int" setter="" getter="" default="1152">
+ Sets the game's main viewport width. On desktop platforms, this is also the initial window width, represented by an indigo-colored rectangle in the 2D editor. Stretch mode settings also use this as a reference when using the [code]canvas_items[/code] or [code]viewport[/code] stretch modes. See also [member display/window/size/viewport_height], [member display/window/size/window_width_override] and [member display/window/size/window_height_override].
</member>
<member name="display/window/size/window_height_override" type="int" setter="" getter="" default="0">
- On desktop platforms, sets the game's initial window height.
- [b]Note:[/b] By default, or when set to 0, the initial window height is the [member display/window/size/viewport_height]. This setting is ignored on iOS, Android, and HTML5.
+ On desktop platforms, overrides the game's initial window height. See also [member display/window/size/window_width_override], [member display/window/size/viewport_width] and [member display/window/size/viewport_height].
+ [b]Note:[/b] By default, or when set to [code]0[/code], the initial window height is the [member display/window/size/viewport_height]. This setting is ignored on iOS, Android, and HTML5.
</member>
<member name="display/window/size/window_width_override" type="int" setter="" getter="" default="0">
- On desktop platforms, sets the game's initial window width.
- [b]Note:[/b] By default, or when set to 0, the initial window width is the viewport [member display/window/size/viewport_width]. This setting is ignored on iOS, Android, and HTML5.
+ On desktop platforms, overrides the game's initial window width. See also [member display/window/size/window_height_override], [member display/window/size/viewport_width] and [member display/window/size/viewport_height].
+ [b]Note:[/b] By default, or when set to [code]0[/code], the initial window width is the viewport [member display/window/size/viewport_width]. This setting is ignored on iOS, Android, and HTML5.
</member>
<member name="display/window/vsync/vsync_mode" type="int" setter="" getter="" default="1">
Sets the V-Sync mode for the main game window.
diff --git a/main/main.cpp b/main/main.cpp
index 9e7d9e6f5a..6559b69f2e 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -161,7 +161,7 @@ static DisplayServer::WindowMode window_mode = DisplayServer::WINDOW_MODE_WINDOW
static DisplayServer::ScreenOrientation window_orientation = DisplayServer::SCREEN_LANDSCAPE;
static DisplayServer::VSyncMode window_vsync_mode = DisplayServer::VSYNC_ENABLED;
static uint32_t window_flags = 0;
-static Size2i window_size = Size2i(1024, 600);
+static Size2i window_size = Size2i(1152, 648);
static int init_screen = -1;
static bool init_fullscreen = false;