This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

engine.config Functions

This set of functions allows for reading values (settings) from the configuration file and writing back into it.

Notice
Use engine.console functions, if you want to change Console variables or execute Console commands.

int engine.config.getBool (string setting)

Reads a boolean value of a given setting.

Arguments

  • string setting - Name of the setting.

Return value

Boolean value (0 or 1) of the setting. 0 stands for "false", 1 stands for "true".

int engine.config.getBool (string name, int value)

Reads a boolean value of a given setting and returns a custom value if a given setting is not found in the configuration file.

Arguments

  • string name - Name of the setting.
  • int value - Custom value to be returned if nothing is found.

Return value

Boolean value (0 or 1) of the setting. 0 stands for "false", 1 stands for "true".

float engine.config.getFloat (string setting)

Reads a float value of a given setting.

Arguments

  • string setting - Name of the setting.

Return value

Float value of the setting.

float engine.config.getFloat (string name, float value)

Reads a float value of a given setting.

Arguments

  • string name - Name of the setting.
  • float value - Custom value to be returned if nothing is found.

Return value

Float value of the setting or a custom one.

int engine.config.getInt (string setting)

Reads an integer value of a given setting.

Arguments

  • string setting - Name of the setting.

Return value

Integer value of the setting.

int engine.config.getInt (string name, int value)

Reads an integer value of a given setting.

Arguments

  • string name - Name of the setting.
  • int value - Custom value to be returned if nothing is found.

Return value

Integer value of the setting.

string engine.config.getString (string setting)

Reads a string value of a given setting.

Arguments

  • string setting - Name of the setting.

Return value

String value of the setting.

string engine.config.getString (string name, string value)

Reads a string value of a given setting.

Arguments

  • string name - Name of the setting.
  • string value - Custom value to be returned if nothing is found.

Return value

String value of the setting or a custom one.

int engine.config.isExist (string setting)

Checks, whether a setting with a given name exists.

Arguments

  • string setting - Name of the setting.

Return value

1 if the setting exists; otherwise, 0.

void engine.config.remove (string setting)

Removes a setting with a given name from the configuration file.

Arguments

  • string setting - Name of the setting.

void engine.config.setBool (string setting, int value)

Sets a boolean value of a given setting. If a setting with this name already exists, its value is overwritten.

Arguments

  • string setting - Name of the setting.
  • int value - Boolean value (0 or 1). 0 stands for "false", 1 stands for "true".

void engine.config.setFloat (string setting, float value)

Sets a float value of a given setting. If a setting with this name already exists, its value is overwritten.

Arguments

  • string setting - Name of the setting.
  • float value - Float value.

engine.config.setInt (string setting, int value)

Sets an integer value of a given setting. If a setting with this name already exists, its value is overwritten.

Arguments

  • string setting - Name of the setting.
  • int value - Integer value.

void engine.config.setString (string setting, string value)

Sets a string value of a given setting. If a setting with this name already exists, its value is overwritten.

Arguments

  • string setting - Name of the setting.
  • string value - String value.
Last update: 2017-07-03
Build: ()