engine.config Functions
Reads values (settings) from the configuration file and writes back into it.
Config Class
Members
void engine.config.setBool(string name, int value)
Sets a boolean value of a given setting. If a setting with this name already exists, its value is overwritten.Arguments
- string name - Name of the setting.
- int value - Boolean value (0 or 1). 0 stands for "false", 1 stands for "true".
int engine.config.getBool(string name)
Reads a boolean value of a given setting.Arguments
- string name - 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.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".int engine.config.isExist(string name)
Checks, whether a setting with a given name exists.Arguments
- string name - Name of the setting.
Return value
1 if the setting exists; otherwise, 0.void engine.config.setFloat(string name, float value)
Sets a float value of a given setting. If a setting with this name already exists, its value is overwritten.Arguments
- string name - Name of the setting.
- float value - Float value.
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.float engine.config.getFloat(string name)
Reads a float value of a given setting.Arguments
- string name - Name of the setting.
Return value
Float value of the setting.void engine.config.setInt(string name, int value)
Sets an integer value of a given setting. If a setting with this name already exists, its value is overwritten.Arguments
- string name - Name of the setting.
- int value - Integer value.
int engine.config.getInt(string name)
Reads an integer value of a given setting.Arguments
- string name - 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.void engine.config.setString(string name, string value)
Sets a string value of a given setting. If a setting with this name already exists, its value is overwritten.Arguments
- string name - Name of the setting.
- string value - String value.
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.string engine.config.getString(string name)
Reads a string value of a given setting.Arguments
- string name - Name of the setting.
Return value
String value of the setting.int engine.config.flush()
Flushes config into the current file.Return value
Returns 1 if the config is successfully flushed into the file; otherwise, 0.int engine.config.load(string name)
Loads config from the file.Arguments
- string name - Config file name.
Return value
Returns 1 if the config is successfully loaded from the file; otherwise, 0 is returned.void engine.config.remove(string name)
Removes a setting with a given name from the configuration file.Arguments
- string name - Name of the setting.
int engine.config.save(string name)
Saves config into the file.Arguments
- string name - Config file name.
Return value
Returns 1 if the config is successfully saved into the file; otherwise, 0 is returned.Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)