This page has been translated automatically.
Programming
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
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 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 a path to the binary executable file.

Return value

Path to the executable file.

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(int num = 0)

Returns a path to the -data_path directory specified at the engine startup.

Arguments

  • int num - Number of the specified -data_path directory. For example, if the are three directories, their numbers will be 1, 2 and 3.

Return value

Path to the data directory.

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.isMainThread()

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.getNumDataPaths()

Returns the number of the specified -data_path directories.

Return value

Number of data directories.

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.

virtual string engine.getPluginName(int num) const =0

Returns the name of the loaded plugin by its index.

Arguments

  • int num - Index of the loaded plugin.

Return value

Loaded plugin name.

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.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.

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.

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

void engine.message(string format, ... values)

Adds a new message to the list of messages.

Arguments

Last update: 2017-07-03
Build: ()