-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul Project Settings page #10282
Open
tetrapod00
wants to merge
1
commit into
godotengine:master
Choose a base branch
from
tetrapod00:expand-project-settings
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+133
−7
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,138 @@ | ||
:article_outdated: True | ||
|
||
.. _doc_project_settings: | ||
|
||
Project Settings | ||
================ | ||
|
||
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>`. | ||
There are dozens of settings you can change to control a project's execution, | ||
including physics, rendering, and windowing settings. These settings can be | ||
changed from the **Project Settings** window, from code, or by manually editing | ||
the ``project.godot`` file. You can see a full list of settings in the | ||
:ref:`ProjectSettings <class_ProjectSettings>` class. | ||
|
||
Internally, Godot stores the settings for a project in a ``project.godot`` file, | ||
a plain text file in INI format. While this is human-readable and version control | ||
friendly, it's not the most convenient to edit. For that reason, the | ||
**Project Settings** window is available to edit these settings. To open the | ||
Project Settings, select **Project > Project Settings** from the main menu. | ||
|
||
.. figure:: img/project_settings_basic.webp | ||
:align: center | ||
|
||
The Project Settings window | ||
|
||
The **Project Settings** window is mainly used to change settings in the | ||
**General** tab. Additionally, there are tabs for the | ||
:ref:`Input Map <doc_input_examples_input_map>`, | ||
:ref:`Localization <doc_internationalizing_games>`, | ||
:ref:`Globals <doc_singletons_autoload>`, | ||
:ref:`Plugins <doc_installing_plugins_enabling_a_plugin>`, and | ||
**Import Defaults**. Usage of these other tabs is documented elsewhere. | ||
|
||
Changing project settings | ||
------------------------- | ||
|
||
The **General** tab of the project settings window works much like the inspector. | ||
It displays a list of project settings which you can change, just like inspector | ||
properties. There is a list of categories on the left, which you can use to select | ||
related groups of settings. You can also search for a specific setting with the | ||
**Filter Settings** field. | ||
|
||
Each setting has a default value. Settings can be reset to their default values | ||
by clicking the circular arrow **Reset** button next to each property. | ||
|
||
Changing project settings from code | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
You can use :ref:`set_setting() <class_ProjectSettings_method_set_setting>` to | ||
change a setting's value from code: | ||
|
||
.. tabs:: | ||
.. code-tab:: gdscript GDScript | ||
|
||
ProjectSettings.set_setting("application/run/max_fps", 60) | ||
ProjectSettings.set_setting("display/window/size/mode", DisplayServer.WINDOW_MODE_WINDOWED) | ||
|
||
.. code-tab:: csharp | ||
|
||
ProjectSettings.SetSetting("application/run/max_fps", 60); | ||
ProjectSettings.SetSetting("display/window/size/mode", (int)DisplayServer.WindowMode.Windowed); | ||
|
||
However, many project settings are only read once when the game starts. After | ||
that, changing the setting with ``set_setting()`` will have no effect. Instead, | ||
most settings have a corresponding property or method on a runtime class like | ||
:ref:`Engine <class_Engine>` or :ref:`DisplayServer <class_DisplayServer>`: | ||
|
||
.. tabs:: | ||
.. code-tab:: gdscript GDScript | ||
|
||
Engine.max_fps = 60 | ||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED) | ||
|
||
.. code-tab:: csharp | ||
|
||
Engine.MaxFps = 60; | ||
DisplayServer.WindowSetMode(DisplayServer.WindowMode.Windowed); | ||
|
||
In general, project settings are duplicated at runtime in the | ||
:ref:`Engine <class_Engine>`, :ref:`PhysicsServer2D <class_PhysicsServer2D>`, | ||
:ref:`PhysicsServer3D <class_PhysicsServer3D>`, | ||
:ref:`RenderingServer <class_RenderingServer>`, | ||
:ref:`Viewport <class_Viewport>`, or :ref:`Window <class_Window>` classes. In the | ||
:ref:`ProjectSettings <class_ProjectSettings>` class reference, settings | ||
links to their equivalent runtime property or method. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was originally "each project setting links to its runtime equivalent" but that's not true until #9944 is done... |
||
|
||
Reading project settings | ||
------------------------ | ||
|
||
You can read project settings with | ||
:ref:`get_setting() <class_ProjectSettings_method_get_setting>` or | ||
:ref:`get_setting_with_override() <class_ProjectSettings_method_get_setting_with_override>`: | ||
|
||
.. tabs:: | ||
.. code-tab:: gdscript GDScript | ||
|
||
var max_fps = ProjectSettings.get_setting("application/run/max_fps") | ||
var window_mode = ProjectSettings.get_setting("display/window/size/mode") | ||
|
||
.. code-tab:: csharp | ||
|
||
int maxFps = (int)ProjectSettings.GetSetting("application/run/max_fps"); | ||
var windowMode = (DisplayServer.WindowMode)(int)ProjectSettings.GetSetting("display/window/size/mode"); | ||
|
||
Since many project settings are only read once at startup, the value in the | ||
project settings may no longer be accurate. In these cases, it's better to read | ||
the value from the runtime equivalent property or method: | ||
|
||
.. tabs:: | ||
.. code-tab:: gdscript GDScript | ||
|
||
var max_fps = Engine.max_fps | ||
var window_mode = DisplayServer.window_get_mode() | ||
|
||
.. code-tab:: csharp | ||
|
||
int maxFps = Engine.MaxFps; | ||
DisplayServer.WindowMode windowMode = DisplayServer.WindowGetMode(); | ||
|
||
Manually editing project.godot | ||
------------------------------ | ||
|
||
You can open the ``project.godot`` file using a text editor and manually | ||
change project settings. Note that if the ``project.godot`` file does not have a | ||
stored value for a particular setting, it is implicitly the default value of | ||
that setting. This means that if you are are manually editing the file, you may | ||
have to write in both the setting name *and* the value. | ||
|
||
In general, it is recommended to use the Project Settings window rather than | ||
manually edit ``project.godot``. | ||
|
||
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. | ||
Advanced project settings | ||
------------------------- | ||
|
||
To access that dialog, select Project -> Project Settings. | ||
.. figure:: img/project_settings_advanced.webp | ||
:align: center | ||
|
||
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'. | ||
The advanced project settings | ||
|
||
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. | ||
By default, only some project settings are shown. To see all the project | ||
settings, enable the **Advanced Settings** toggle. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the set of example project settings used throughout the page, I picked these two because:
I'm open to suggestions for alternate project settings to use as examples. We can also add a third example if there is a good string example to use.