This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
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.interface Functions

Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
Warning
Interface plugin is deprecated and no longer supported. We can't guarantee the stable work of the plugin.

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

Interface Class

Members


int engine.interface.findWindow ( Gui gui ) #

Returns the number of the Interface window rendered by the given gui instance.

Arguments

  • Gui gui - Gui instance.

Return value

Window number, if it exists; otherwise, -1.

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.
Notice
The function won't return a value in the following cases:
  • If the parent flag of the interface window is set to 0.
  • If the window is hidden.
  • If the window is not focused.
  • If the window is not an instance of the WidgetWindow class.

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.
Notice
The function won't return a value in the following cases:
  • If the parent flag of the interface window is set to 0.
  • If the window is hidden.
  • If the window is not focused.
  • If the window is not an instance of the WidgetWindow class.

Arguments

  • int height - Window height.

Return value

Y coordinate of the window.

int engine.interface.getHeight ( ) #

Returns the screen space height. 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

Number of Interface windows.

int engine.interface.getPositionX ( ) #

Returns the X coordinate of the Interface window.

Return value

X coordinate of the window.

int engine.interface.getPositionY ( ) #

Returns the Y coordinate of the Interface window.

Return value

Y coordinate of the 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.getVisiblePositionX ( int x, int width, int border = INTERFACE_BORDER ) #

Checks if the window of the given width is visible on a screen with the specified border at the given coordinate. If the window is visible, its position will remain the same. Otherwise, it will be updated in order to make the window visible (taking into account the size of the vertical border).

Arguments

  • int x - X coordinate in the screen space.
  • int width - Window width.
  • int border - Horizontal border size.

Return value

The given X coordinate if the window is visible; otherwise, the X coordinate, at which the window will be visible.

int engine.interface.getVisiblePositionY ( int y, int height, int border = INTERFACE_BORDER ) #

Checks if the window of the given height is visible on a screen with the specified border at the given coordinate. If the window is visible, its position will remain the same. Otherwise, it will be updated in order to make the window visible (taking into account the size of the vertical border).

Arguments

  • int y - Y coordinate in the screen space.
  • int height - Window height.
  • int border - Vertical border size.

Return value

The given Y coordinate if the window is visible; otherwise, the Y coordinate, at which the window will be visible.

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.

InterfaceWindow engine.interface.createWindow ( int flags, string name ) #

Creates a new interface window with the specified name and flags.

Arguments

  • int flags - Interface Window flags combination.
  • string name - Name of the new interface window.

Return value

Interface window.

void engine.interface.releaseWindow ( InterfaceWindow * window ) #

Releases the specified interface window and performs cleanup.

Arguments

Last update: 2022-04-20
Build: ()