You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below are all the available settings, arranged by section. Some settings are not yet exposed in the settings editor (these are marked "hidden setting" below), but can be set manually by right clicking *game.project* and selecting <kbd>Open With ▸ Text Editor</kbd>.
14
+
15
+
## File format
16
+
17
+
The settings in *game.project* are usually changed from within Defold, but the file can also be edited in any standard text editor. The file follows the INI file format standard and looks like this:
18
+
19
+
```ini
20
+
[category1]
21
+
setting1 = value
22
+
setting2 = value
23
+
[category2]
24
+
...
25
+
```
26
+
27
+
A real example is:
28
+
29
+
```ini
30
+
[bootstrap]
31
+
main_collection = /main/main.collectionc
32
+
```
33
+
34
+
which means that the setting *main_collection* belongs to the *bootstrap* category. Whenever a file reference is used, like the example above, the path needs to be appended with a 'c' character, which means you're referencing the compiled version of the file. Also note that the folder containing *game.project* will be the project root, which is why there is an initial '/' in the setting path.
35
+
36
+
37
+
## Runtime access
38
+
39
+
It is possible to read any value from *game.project* at runtime using [`sys.get_config_string(key)`](/ref/sys/#sys.get_config_string), [`sys.get_config_number(key)`](/ref/sys/#sys.get_config_number) and [`sys.get_config_int(key)`](/ref/sys/#sys.get_config_int). Examples:
The key is a combination of the category and setting name, separated by a dot, and written in lowercase letters with any space characters replaced by underscores. Examples: The field "Title" from the "Project" category becomes `project.title` and the "Gravity Y" field from the "Physics" category becomes `physics.gravity_y`.
48
+
:::
49
+
15
50
16
51
## Sections and settings
17
52
53
+
Below are all the available settings, arranged by category.
54
+
18
55
### Project
19
56
20
57
#### Title
@@ -148,9 +185,15 @@ Clear color alpha channel, used by the render script and when the window is crea
148
185
#### Type
149
186
Which type of physics to use, `2D` (default) or `3D`.
150
187
188
+
#### Gravity X
189
+
World gravity along x-axis, `0` by default.
190
+
151
191
#### Gravity Y
152
192
World gravity along y-axis, `-10` by default (natural gravity)
153
193
194
+
#### Gravity Z
195
+
World gravity along z-axis, `0` by default.
196
+
154
197
#### Debug
155
198
Check if physics should be visualized for debugging.
156
199
@@ -160,12 +203,6 @@ Alpha component value for visualized physics, `0`--`1`. The value is `0.9` by de
160
203
#### World Count
161
204
Max number of concurrent physics worlds, `4` by default. If you load more than 4 worlds simultaneously through collection proxies you need to increase this value. Be aware that each physics world allocates a fair amount of memory.
162
205
163
-
#### Gravity X
164
-
World gravity along x-axis, `0` by default.
165
-
166
-
#### Gravity Z
167
-
World gravity along z-axis, `0` by default.
168
-
169
206
#### Scale
170
207
Tells the physics engine how to scale the physics worlds in relation to the game world for numerical precision, `0.01`--`1.0`. If the value is set to `0.02`, it means that the physics engine will view 50 units as 1 meter ($1 / 0.02$). The default value is `1.0`.
171
208
@@ -610,30 +647,6 @@ If checked, enable CPU profiling in release versions of the builds. Normally, yo
610
647
611
648
---
612
649
613
-
## File format
614
-
615
-
The format of the settings file is simple text (INI format) and can be edited by any standard text editor. The format looks like this:
616
-
617
-
```ini
618
-
[category1]
619
-
setting1 = value
620
-
setting2 = value
621
-
[category2]
622
-
...
623
-
```
624
-
625
-
A real example is:
626
-
627
-
```ini
628
-
[bootstrap]
629
-
main_collection = /main/main.collectionc
630
-
```
631
-
632
-
which means that the setting *main_collection* belongs to the *bootstrap* category.
633
-
Whenever a file reference is used, like the example above, the path needs to be appended with a 'c' character, which means you're referencing the compiled version of the file.
634
-
Also note that the folder containing *game.project* will be the project root, which is why there is an initial '/' in the setting path.
635
-
636
-
637
650
## Setting config values on engine startup
638
651
639
652
When the engine starts, it is possible to provide config values from the command line that override the *game.project* settings:
@@ -643,13 +656,14 @@ When the engine starts, it is possible to provide config values from the command
Custom values can---just like any other config value---be read with [`sys.get_config()`](/ref/sys/#sys.get_config):
662
+
Custom values can---just like any other config value---be read with [`sys.get_config_string()`](/ref/sys/#sys.get_config_string) or [`sys.get_config_number()`](/ref/sys/#sys.get_config_number):
0 commit comments