.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_Globals: Globals ======= **Inherits:** :ref:`Object` **Category:** Core Brief Description ----------------- Contains global variables accessible from everywhere. Member Functions ---------------- +------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has` **(** :ref:`String` name **)** const | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_order` **(** :ref:`String` name, :ref:`int` pos **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_order` **(** :ref:`String` name **)** const | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_persisting` **(** :ref:`String` name, :ref:`bool` enable **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_persisting` **(** :ref:`String` name **)** const | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** :ref:`String` name **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`localize_path` **(** :ref:`String` path **)** const | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`globalize_path` **(** :ref:`String` path **)** const | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`save` **(** **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_singleton` **(** :ref:`String` name **)** const | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_singleton` **(** :ref:`String` name **)** const | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`load_resource_pack` **(** :ref:`String` pack **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`save_custom` **(** :ref:`String` file **)** | +------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ Description ----------- Contains global variables accessible from everywhere. Use the normal :ref:`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 --------------------------- .. _class_Globals_has: - :ref:`bool` **has** **(** :ref:`String` name **)** const Return true if a configuration value is present. .. _class_Globals_set_order: - void **set_order** **(** :ref:`String` name, :ref:`int` pos **)** Set the order of a configuration value (influences when saved to the config file). .. _class_Globals_get_order: - :ref:`int` **get_order** **(** :ref:`String` name **)** const Return the order of a configuration value (influences when saved to the config file). .. _class_Globals_set_persisting: - void **set_persisting** **(** :ref:`String` name, :ref:`bool` enable **)** If set to true, this value can be saved to the configuration file. This is useful for editors. .. _class_Globals_is_persisting: - :ref:`bool` **is_persisting** **(** :ref:`String` name **)** const If returns true, this value can be saved to the configuration file. This is useful for editors. .. _class_Globals_clear: - void **clear** **(** :ref:`String` name **)** Clear the whole configuration (not recommended, may break things). .. _class_Globals_localize_path: - :ref:`String` **localize_path** **(** :ref:`String` path **)** const Convert a path to a localized path (res:// path). .. _class_Globals_globalize_path: - :ref:`String` **globalize_path** **(** :ref:`String` path **)** const Convert a localized path (res://) to a full native OS path. .. _class_Globals_save: - :ref:`int` **save** **(** **)** .. _class_Globals_has_singleton: - :ref:`bool` **has_singleton** **(** :ref:`String` name **)** const .. _class_Globals_get_singleton: - :ref:`Object` **get_singleton** **(** :ref:`String` name **)** const .. _class_Globals_load_resource_pack: - :ref:`bool` **load_resource_pack** **(** :ref:`String` pack **)** .. _class_Globals_save_custom: - :ref:`int` **save_custom** **(** :ref:`String` file **)**