ProjectSettings

Inherits: Object

Category: Core

Brief Description

Contains global variables accessible from everywhere.

Member Functions

void add_property_info ( Dictionary hint )
void clear ( String name )
int get_order ( String name ) const
Variant get_setting ( String name ) const
String globalize_path ( String path ) const
bool has_setting ( String name ) const
bool load_resource_pack ( String pack )
String localize_path ( String path ) const
bool property_can_revert ( String name )
Variant property_get_revert ( String name )
int save ( )
int save_custom ( String file )
void set_initial_value ( String name, Variant value )
void set_order ( String name, int position )
void set_setting ( String name, Variant value )

Description

Contains global variables accessible from everywhere. Use the normal Object API, such as “ProjectSettings.get(variable)”, “ProjectSettings.set(variable,value)” or “ProjectSettings.has(variable)” to access them. Variables stored in project.godot are also loaded into ProjectSettings, making this object very useful for reading custom game configuration options.

Member Function Description

Add a custom property info to a property. The dictionary must contain: name:String), and optionally hint:int), hint_string:String.

Example:

ProjectSettings.set("category/property_name", 0)

var property_info = {
    "name": "category/property_name",
    "type": TYPE_INT,
    "hint": PROPERTY_HINT_ENUM,
    "hint_string": "one,two,three"
}

ProjectSettings.add_property_info(property_info)

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

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

Convert a localized path (res://) to a full native OS path.

Return true if a configuration value is present.

Convert a path to a localized path (res:// path).

  • void set_order ( String name, int position )

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