class_globals - dragonsoulz/godot GitHub Wiki

Globals

####Inherits: Object ####Category: Core

Brief Description

Contains global variables accessible from everywhere.

Member Functions

Description

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

Member Function Description

has

Return true if a configuration value is present.

set_order

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

get_order

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

set_persisting

  • void set_persisting ( String name, bool enable )

If set to true, this value can be saved to the configuration file. This is useful for editors.

is_persisting

If returns true, this value can be saved to the configuration file. This is useful for editors.

clear

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

localize_path

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

globalize_path

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