ProjectSettingsSingleton

Contains global variables accessible from everywhere.

Use getSetting, setSetting or hasSetting to access them. Variables stored in project.godot are also loaded into ProjectSettings, making this object very useful for reading custom game configuration options. When naming a Project Settings property, use the full path to the setting including the category. For example, "application/config/name" for the project name. Category and property names can be viewed in the Project Settings dialog. Feature tags: Project settings can be overridden for specific platforms and configurations (debug, release, ...) using url=https://docs.godotengine.org/en/latest/tutorials/export/feature_tags.htmlfeature tags/url. Overriding: Any project setting can be overridden by creating a file named override.cfg in the project's root directory. This can also be used in exported projects by placing this file in the same directory as the project binary. Overriding will still take the base project settings' url=https://docs.godotengine.org/en/latest/tutorials/export/feature_tags.htmlfeature tags/url in account. Therefore, make sure to also override the setting with the desired feature tags if you want them to override base project settings on all platforms and configurations.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

addPropertyInfo
void addPropertyInfo(Dictionary hint)

Adds a custom property info to a property. The dictionary must contain: - name: String (the property's name) - type: long (see Variant.type) - optionally hint: long (see propertyhint) and hint_string: String Example:

clear
void clear(String name)

Clears the whole configuration (not recommended, may break things).

getOrder
long getOrder(String name)

Returns the order of a configuration value (influences when saved to the config file).

getSetting
Variant getSetting(String name)

Returns the value of a setting. Example:

globalizePath
String globalizePath(String path)

Returns the absolute, native OS path corresponding to the localized path (starting with res:// or user://). The returned path will vary depending on the operating system and user preferences. See url=https://docs.godotengine.org/en/3.3/tutorials/io/data_paths.htmlFile paths in Godot projects/url to see what those paths convert to. See also localizePath. Note: globalizePath with res:// will not work in an exported project. Instead, prepend the executable's base directory to the path when running from an exported project:

hasSetting
bool hasSetting(String name)

Returns true if a configuration value is present.

loadResourcePack
bool loadResourcePack(String pack, bool replace_files, long offset)

Loads the contents of the .pck or .zip file specified by pack into the resource filesystem (res://). Returns true on success. Note: If a file from pack shares the same path as a file already in the resource filesystem, any attempts to load that file will use the file from pack unless replace_files is set to false. Note: The optional offset parameter can be used to specify the offset in bytes to the start of the resource pack. This is only supported for .pck files.

localizePath
String localizePath(String path)

Returns the localized path (starting with res://) corresponding to the absolute, native OS path. See also globalizePath.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(ProjectSettingsSingleton other)
opEquals
bool opEquals(typeof(null) n)
propertyCanRevert
bool propertyCanRevert(String name)

Returns true if the specified property exists and its initial value differs from the current value.

propertyGetRevert
Variant propertyGetRevert(String name)

Returns the specified property's initial value. Returns null if the property does not exist.

save
GodotError save()

Saves the configuration to the project.godot file. Note: This method is intended to be used by editor plugins, as modified ProjectSettings can't be loaded back in the running app. If you want to change project settings in exported projects, use saveCustom to save override.cfg file.

saveCustom
GodotError saveCustom(String file)

Saves the configuration to a custom file. The file extension must be .godot (to save in text-based ConfigFile format) or .binary (to save in binary format). You can also save override.cfg file, which is also text, but can be used in exported projects unlike other formats.

setInitialValue
void setInitialValue(String name, VariantArg1 value)

Sets the specified property's initial value. This is the value the property reverts to.

setOrder
void setOrder(String name, long position)

Sets the order of a configuration value (influences when saved to the config file).

setSetting
void setSetting(String name, VariantArg1 value)

Sets the value of a setting. Example:

toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Static functions

_new
ProjectSettingsSingleton _new()

Construct a new instance of ProjectSettingsSingleton. Note: use memnew!ProjectSettingsSingleton instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta