Engine Functions
The Engine class is required for the engine initialization and executing the main loop of the program. Also, you can get the engine startup options through this class.
See Also
Analogues of C++ runWorldFunction() methods are described in the engine.world class reference.
Analogues of C++ runEditorFunction() methods are described in the engine.editor class reference.
Analogues of C++ runSystemFunction() methods are described in the engine.system class reference.
Engine Class
Members
string engine.getAppPath()
Returns the path to a directory where binary executable file is stored.Return value
Path to a directory where binary executable file is stored.string engine.getArg(int num)
Returns a command line argument by its index.Arguments
- int num - Index of the command line argument.
Return value
Command line argument.string engine.getCachePath()
Returns a path to a directory where cached files will be stored.Return value
Path to the directory with cached files.ControlsApp engine.getControls()
Returns a ControlsApp object that handles input from the current application window.Return value
An instance of the ControlsApp class.string engine.getDataPath()
Returns a path to the -data_path directory specified at the engine startup.Return value
Path to the data directory.string engine.getEditorCache()
Returns a path to the editor script cache file.Return value
Path to the editor script cache.string engine.getEditorScript()
Returns a path to the editor script (provided by the -editor_script command line argument).Return value
Path to the editor script.string engine.getError()
Returns the system error message.Return value
The system error message of the current frame, if there is one; otherwise an empty string.string engine.getExternDefines()
Returns the external definitions specified on the application start-up.Return value
The list of external definitions.Gui engine.getGui()
Returns a system GUI associated with the engine and used to manipulate the user interface.Return value
System GUI used to manipulate the user interface.string engine.getHomePath()
Returns a path to the user's home directory.Return value
Path to the user's home directory.float engine.getInterfaceTime()
Returns the total accumulative time spent on rendering GUI widgets.Return value
Time value, in milliseconds.int engine.isMain()
Checks if the current thread is main.Return value
1 if the current thread is main; otherwise, 0.string engine.getMessage()
Returns the last system message of the current frame, or empty string if there are no messages.Return value
The last system message.virtual int engine.getNumArgs() const =0
Returns the number of command line arguments.Return value
Number of command line arguments.int engine.getNumPluginPaths()
Returns the number of paths to directories with plugins specified via -plugin_path command-line option.Return value
Number of the specifed paths to directories with plugins.int engine.getNumPlugins()
Returns the number of loaded plugins.Return value
Number of plugins.string engine.getPluginPath(int num)
Returns a path to a plugin directory specified via -plugin_path.Arguments
- int num - Plugin path number in the row of the specified plugin paths.
Return value
Path to a plugin directory.float engine.getPresentTime()
Returns the total time spent on waiting for the GPU after all calculations on the CPU are completed. See the Profiler article for details.Return value
Time value, in milliseconds.float engine.getRenderTime()
Returns the time value, required to prepare all data to be rendered in the current frame and feed rendering commands from the CPU to the GPU. See the Profiler article for details.Return value
Rendering time value, milliseconds.string engine.getSavePath()
Returns a path to a directory where a default configuration file, saved files and screenshots will be stored.Return value
Path to a directory with the default configuration file, saved files, etc.string engine.getSoundApp()
Returns the current sound API.Return value
A sound API instance.const char * engine.getSystemCache()
Returns a path to the system script cache.Return value
Path to the system script cache.string engine.getSystemScript()
Returns a path to the system script.Return value
Path to the system script.float engine.getTotalTime()
Returns the total time that both rendering and calculating of the frame took (the duration of the main loop in the application execution sequence).Return value
Total time value, milliseconds.float engine.getUpdateTime()
Returns the duration of the update phase, during which the objects are prepared for their collision response to be calculated.Return value
The update phase duration value, milliseconds.string engine.getVideoApp()
Returns a graphics API used for rendering.Return value
Graphics API used for rendering.string engine.getVideoApp()
Returns a graphics API used for rendering.Return value
Graphics API used for rendering.void engine.dialogError(string title)
Displays a dialog window with errors set using the error() function.Arguments
- string title - Title to be displayed in the error window.
void engine.dialogMessage(string title)
Displays a dialog window with the last message set using the message() function.Arguments
- string title - Title to be displayed in the message window.
void engine.error(string format, ... values)
Adds a text describing an error to the list of errors.Arguments
- string format - Format of the error text. See the formatting string description.
- ... values - Arguments, multiple allowed.
void engine.message(string format, ... values)
Adds a new message to the list of messages.Arguments
- string format - Format of the message text. See the formatting string description.
- ... values - Arguments, multiple allowed.
Last update: 2018-08-10
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)