engine.config Functions
This set of functions allows for reading values (settings) from the configuration file and writing back into it.
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
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)