Skip to content

Commit c477a8e

Browse files
authored
Merge pull request #10282 from tetrapod00/expand-project-settings
Overhaul Project Settings page
2 parents 73d92a8 + 42abf26 commit c477a8e

File tree

5 files changed

+133
-7
lines changed

5 files changed

+133
-7
lines changed
27.8 KB
Loading
13.7 KB
Loading
Lines changed: 129 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,138 @@
1-
:article_outdated: True
2-
31
.. _doc_project_settings:
42

53
Project Settings
64
================
75

8-
This page explains how to use the Project Settings window. If you would like to access and modify project settings via code, see :ref:`ProjectSettings <class_ProjectSettings>`.
6+
There are dozens of settings you can change to control a project's execution,
7+
including physics, rendering, and windowing settings. These settings can be
8+
changed from the **Project Settings** window, from code, or by manually editing
9+
the ``project.godot`` file. You can see a full list of settings in the
10+
:ref:`ProjectSettings <class_ProjectSettings>` class.
11+
12+
Internally, Godot stores the settings for a project in a ``project.godot`` file,
13+
a plain text file in INI format. While this is human-readable and version control
14+
friendly, it's not the most convenient to edit. For that reason, the
15+
**Project Settings** window is available to edit these settings. To open the
16+
Project Settings, select **Project > Project Settings** from the main menu.
17+
18+
.. figure:: img/project_settings_basic.webp
19+
:align: center
20+
21+
The Project Settings window
22+
23+
The **Project Settings** window is mainly used to change settings in the
24+
**General** tab. Additionally, there are tabs for the
25+
:ref:`Input Map <doc_input_examples_input_map>`,
26+
:ref:`Localization <doc_internationalizing_games>`,
27+
:ref:`Globals <doc_singletons_autoload>`,
28+
:ref:`Plugins <doc_installing_plugins_enabling_a_plugin>`, and
29+
**Import Defaults**. Usage of these other tabs is documented elsewhere.
30+
31+
Changing project settings
32+
-------------------------
33+
34+
The **General** tab of the project settings window works much like the inspector.
35+
It displays a list of project settings which you can change, just like inspector
36+
properties. There is a list of categories on the left, which you can use to select
37+
related groups of settings. You can also search for a specific setting with the
38+
**Filter Settings** field.
39+
40+
Each setting has a default value. Settings can be reset to their default values
41+
by clicking the circular arrow **Reset** button next to each property.
42+
43+
Changing project settings from code
44+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45+
46+
You can use :ref:`set_setting() <class_ProjectSettings_method_set_setting>` to
47+
change a setting's value from code:
48+
49+
.. tabs::
50+
.. code-tab:: gdscript GDScript
51+
52+
ProjectSettings.set_setting("application/run/max_fps", 60)
53+
ProjectSettings.set_setting("display/window/size/mode", DisplayServer.WINDOW_MODE_WINDOWED)
54+
55+
.. code-tab:: csharp
56+
57+
ProjectSettings.SetSetting("application/run/max_fps", 60);
58+
ProjectSettings.SetSetting("display/window/size/mode", (int)DisplayServer.WindowMode.Windowed);
59+
60+
However, many project settings are only read once when the game starts. After
61+
that, changing the setting with ``set_setting()`` will have no effect. Instead,
62+
most settings have a corresponding property or method on a runtime class like
63+
:ref:`Engine <class_Engine>` or :ref:`DisplayServer <class_DisplayServer>`:
64+
65+
.. tabs::
66+
.. code-tab:: gdscript GDScript
67+
68+
Engine.max_fps = 60
69+
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
70+
71+
.. code-tab:: csharp
72+
73+
Engine.MaxFps = 60;
74+
DisplayServer.WindowSetMode(DisplayServer.WindowMode.Windowed);
75+
76+
In general, project settings are duplicated at runtime in the
77+
:ref:`Engine <class_Engine>`, :ref:`PhysicsServer2D <class_PhysicsServer2D>`,
78+
:ref:`PhysicsServer3D <class_PhysicsServer3D>`,
79+
:ref:`RenderingServer <class_RenderingServer>`,
80+
:ref:`Viewport <class_Viewport>`, or :ref:`Window <class_Window>` classes. In the
81+
:ref:`ProjectSettings <class_ProjectSettings>` class reference, settings
82+
links to their equivalent runtime property or method.
83+
84+
Reading project settings
85+
------------------------
86+
87+
You can read project settings with
88+
:ref:`get_setting() <class_ProjectSettings_method_get_setting>` or
89+
:ref:`get_setting_with_override() <class_ProjectSettings_method_get_setting_with_override>`:
90+
91+
.. tabs::
92+
.. code-tab:: gdscript GDScript
93+
94+
var max_fps = ProjectSettings.get_setting("application/run/max_fps")
95+
var window_mode = ProjectSettings.get_setting("display/window/size/mode")
96+
97+
.. code-tab:: csharp
98+
99+
int maxFps = (int)ProjectSettings.GetSetting("application/run/max_fps");
100+
var windowMode = (DisplayServer.WindowMode)(int)ProjectSettings.GetSetting("display/window/size/mode");
101+
102+
Since many project settings are only read once at startup, the value in the
103+
project settings may no longer be accurate. In these cases, it's better to read
104+
the value from the runtime equivalent property or method:
105+
106+
.. tabs::
107+
.. code-tab:: gdscript GDScript
108+
109+
var max_fps = Engine.max_fps
110+
var window_mode = DisplayServer.window_get_mode()
111+
112+
.. code-tab:: csharp
113+
114+
int maxFps = Engine.MaxFps;
115+
DisplayServer.WindowMode windowMode = DisplayServer.WindowGetMode();
116+
117+
Manually editing project.godot
118+
------------------------------
119+
120+
You can open the ``project.godot`` file using a text editor and manually
121+
change project settings. Note that if the ``project.godot`` file does not have a
122+
stored value for a particular setting, it is implicitly the default value of
123+
that setting. This means that if you are are manually editing the file, you may
124+
have to write in both the setting name *and* the value.
125+
126+
In general, it is recommended to use the Project Settings window rather than
127+
manually edit ``project.godot``.
9128

10-
Godot stores the project settings in a project.godot file, a plain text file in INI format. There are dozens of settings you can change to control a project's execution. To simplify this process, Godot provides a project settings dialog, which acts as a front-end to editing a project.godot file.
129+
Advanced project settings
130+
-------------------------
11131

12-
To access that dialog, select Project -> Project Settings.
132+
.. figure:: img/project_settings_advanced.webp
133+
:align: center
13134

14-
Once the window opens, let's select a main scene. Locate the `Application/Run/Main Scene` property and click on it to select 'hello.tscn'.
135+
The advanced project settings
15136

16-
The project settings dialog provides a lot of options that can be saved to a project.godot file and shows their default values. If you change a value, a tick appears to the left of its name. This means that the property will be saved in the project.godot file and remembered.
137+
By default, only some project settings are shown. To see all the project
138+
settings, enable the **Advanced Settings** toggle.

tutorials/inputs/input_examples.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ avoid this, make sure to test the event type first:
149149
}
150150
}
151151

152+
.. _doc_input_examples_input_map:
153+
152154
InputMap
153155
--------
154156

tutorials/plugins/editor/installing_plugins.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ plugin's ``addons/`` folder into your project folder to merge the new folder
5353
contents with the existing one. Your file manager may ask you whether to write
5454
into the folder; answer **Yes**. No files will be overwritten in the process.
5555

56+
.. _doc_installing_plugins_enabling_a_plugin:
57+
5658
Enabling a plugin
5759
~~~~~~~~~~~~~~~~~
5860

0 commit comments

Comments
 (0)