UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials

engine.interface Functions

This set of functions is available when the Interface plugin is loaded.

int INTERFACE_WINDOW_CLOSE

Description

An Interface window has a close button.

int INTERFACE_WINDOW_FRAME

Description

An Interface window has only a frame (no title bar).

int INTERFACE_WINDOW_MAXIMIZE

Description

An Interface window has a maximize button.

int INTERFACE_WINDOW_MINIMIZE

Description

An Interface window has a minimize button.

int INTERFACE_WINDOW_TITLE

Description

An Interface window has a title bar.

int engine.interface.getCenterPositionX (int width)

Returns the coordinate along the X axis, at which the window of the given width will be positioned in the center of the screen.

Arguments

  • int width - Window width.

Return value

X coordinate of the window.

int engine.interface.getCenterPositionY (int height)

Returns the coordinate along the Y axis, at which the window of the given height will be positioned in the center of the screen.

Arguments

  • int height - Window height.

Return value

Y coordinate of the window.

int engine.interface.getHeight ()

Returns the screen space hight. If there are two monitors arranged vertically, the height of two monitors is returned.

Return value

Screen height.

int engine.interface.getMouseX ()

Returns the X-coordinate (in the screen space) of the mouse cursor.

Return value

X-coordinate of the mouse cursor.

int engine.interface.getMouseY ()

Returns the Y-coordinate (in the screen space) of the mouse cursor.

Return value

Y-coordinate of the mouse cursor.

int engine.interface.getNumScreens ()

Returns the number of available screens (monitors).

Return value

The number of screens.

int engine.interface.getNumWindows ()

Returns the number of Interface windows.

Return value

The number of Interface windows.

int engine.interface.getPositionX ()

Returns the X-coordinate (in the screen space) of the main application window.

Return value

X-coordinate of an upper right corner of the application window.

int engine.interface.getPositionY ()

Returns the Y-coordinate (in the screen space) of the main application window.

Return value

Y-coordinate of an upper right corner of the application window.

int engine.interface.getScreenHeight (int num)

Returns the height of the given screen (monitor).

Arguments

  • int num - Screen number.

Return value

Height of the screen.

int engine.interface.getScreenPositionX (int num)

Returns the position of the given screen (monitor) in a horizontal row in the screen space. If there are two monitors arranged horizontally, the X-coordinate position of the first monitor is 0 and of the second one, for example, 1280.

Arguments

  • int num - Screen number.

Return value

X-coordinate position of the screen.

int engine.interface.getScreenPositionY (int num)

Returns the position of the given screen (monitor) in a vertical column in the screen space. If there are two monitors arranged vertically, the Y-coordinate position of the first monitor is 0 and of the second one, for example, 1024.

Arguments

  • int num - Screen number.

Return value

Y-coordinate position of the screen.

int engine.interface.getScreenWidth (int num)

Returns the width of the given screen (monitor).

Arguments

  • int num - Screen number.

Return value

Width of the screen.

int engine.interface.getWidth ()

Returns the screen space width. If there are two monitors arranged horizontally, the width of two monitors is returned.

Return value

Screen width.

InterfaceWindow engine.interface.getWindow (int num)

Returns an Interface window by its number.

Arguments

  • int num - Interface window number.

Return value

Interface window.

void engine.interface.setMouse (int x, int y)

Sets position (in screen space coordinates) of the mouse.

Arguments

  • int x - X-coordinate of the mouse cursor.
  • int y - Y-coordinate of the mouse cursor.

void engine.interface.setPosition (int x, int y)

Sets position (in screen space coordinates) of the main application window.

Arguments

  • int x - X-coordinate of an upper right corner of the application window.
  • int y - Y-coordinate of an upper right corner of the application window.
Last update: 2017-07-03