This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
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
创建内容
内容优化
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Unigine::EngineWindow Class

Header: #include <UnigineWindowManager.h>

EngineWindow Class

Enums

HITTEST#

NameDescription
HITTEST_NORMAL = 0Client area of the window.
HITTEST_DRAGGABLE = 1Area of the window, by clicking onto which the window can be moved.
HITTEST_RESIZE_TOPLEFT = 2Area of the window that can be dragged to resize the window to the top and/or left direction.
HITTEST_RESIZE_TOP = 3Area of the window that can be dragged to resize the window to the top direction.
HITTEST_RESIZE_TOPRIGHT = 4Area of the window that can be dragged to resize the window to the top and/or right direction.
HITTEST_RESIZE_RIGHT = 5Area of the window that can be dragged to resize the window to the right direction.
HITTEST_RESIZE_BOTTOMRIGHT = 6Area of the window that can be dragged to resize the window to the bottom and/or right direction.
HITTEST_RESIZE_BOTTOM = 7Area of the window that can be dragged to resize the window to the bottom direction.
HITTEST_RESIZE_BOTTOMLEFT = 8Area of the window that can be dragged to resize the window to the bottom and/or left direction.
HITTEST_RESIZE_LEFT = 9Area of the window that can be dragged to resize the window to the left direction.

STATE#

NameDescription
STATE_SEPARATE_WINDOW = 0Separate system window.
STATE_SEPARATE_GROUP = 1Separate system window group.
STATE_NESTED_WINDOW = 2Nested window, a part of a window group.
STATE_NESTED_GROUP = 3Nested group of windows, a part of a window group.

GROUP_TYPE#

NameDescription
GROUP_TYPE_NONE = 0A separate window inside the group.
GROUP_TYPE_TAB = 1Windows are arranged into a group of tabs with a selected window displayed atop the others in the group.
GROUP_TYPE_HORIZONTAL = 2Windows are arranged into a horizontally displayed group.
GROUP_TYPE_VERTICAL = 3Windows are arranged into a vertically displayed group.

CALLBACK_INDEX#

NameDescription
CALLBACK_WINDOW_EVENT = 0Callback on the window event.
CALLBACK_FUNC_UPDATE = 1Callback after the window update.
CALLBACK_FUNC_RENDER = 2Callback after the window rendering.
CALLBACK_FUNC_RENDER_GUI = 3Callback after the gui rendering.
CALLBACK_FUNC_SWAP = 4Callback before calling the window swap.
NUM_CALLBACKS = 5Callback counter.

FULLSCREEN_STATE#

NameDescription
FULLSCREEN_STATE_NONE = 0Non-maximized window.
FULLSCREEN_STATE_FULLWINDOW = 1Window expanded to the maximum size of the desktop area of the current display.
FULLSCREEN_STATE_FULLSCREEN = 2Window expanded to the whole display area.

Members


void setMain ( bool main ) #

Sets the window as the main window.
Notice
There may be several windows that are set as main, or no main windows at all.

Arguments

  • bool main - true to set the window as the main window, otherwise false.

bool isMain ( ) const#

Returns a value indicating if this window is the main window.

Return value

true if the window is the main window, otherwise false.

void setCamera ( const Ptr<Camera> & camera ) #

Sets the camera the image from which is rendered to the engine window. This value has a higher priority over the main camera flag.

Arguments

Ptr<Camera> getCamera ( ) const#

Returns the camera the image from which is rendered to the engine window. This value has a higher priority over the main camera flag.

Ptr<Gui> getGui ( ) const#

Returns the parent Gui for a nested engine window.

Return value

Gui instance.

Ptr<Gui> getSelfGui ( ) const#

Returns Gui instance for a fully-featured system window. For a nested window, may return nullptr.

Return value

Gui instance.

int getDisplayIndex ( ) const#

Returns the number of the display, on which the window is currently displayed.

Return value

Number of the display, on which the window is currently displayed.

bool isSeparateWindow ( ) const#

Returns a value indicating if this window is an independent system window.

Return value

true if the window is a separate window, otherwise false.

bool isSeparateGroup ( ) const#

Returns a value indicating if this window is an independent group of windows located on the desktop.

Return value

true if the window is a separate window, otherwise false.

bool isNestedWindow ( ) const#

Returns a value indicating if this window is a part of a window group.

Return value

true if the window is a nested window, otherwise false.

bool isNestedGroup ( ) const#

Returns a value indicating if this window group is a part of a window group.

Return value

true if the window group is nested to another window group, otherwise false.

bool isWindow ( ) const#

Returns a value indicating if the object is a separate or a nested window.

Return value

true for a separate or a nested window, otherwise false.

bool isGroup ( ) const#

Returns a value indicating if the object is a separate or a nested group of windows.

Return value

true for a separate or a nested group of windows, otherwise false.

bool isNested ( ) const#

Returns a value indicating if the object is a nested window or group of windows.

Return value

true for a nested window or group of windows, otherwise false.

bool isSeparate ( ) const#

Returns a value indicating if the object is a separate window or group of windows.

Return value

true for a separate window or group of windows, otherwise false.

EngineWindow::STATE getState ( ) const#

Returns the window state: if it's a separate or nested window or group of windows.

Return value

Window state.

EngineWindow::GROUP_TYPE getGroupType ( ) const#

Returns the window group type — vertical, horizontal, tab arrangement of windows, or an independent window inside a group.

Return value

Window group type.

void setPosition ( const Math::ivec2 & position ) #

Sets the position of the left top corner of the engine window in the screen coordinates. In case of several displays, the position is relative to the main display.

Arguments

  • const Math::ivec2 & position - Engine window screen position — coordinates of the left top corner.

Math::ivec2 getPosition ( ) const#

Returns the position of the left top corner of the engine window in the screen coordinates. In case of several displays, the position is relative to the main display.

Return value

Engine window screen position — coordinates of the left top corner.

Math::ivec2 getClientPosition ( ) const#

Sets the position of the left top corner of the window content area (without the top bar and border of the system window) in the screen coordinates. In case of several displays, the position is relative to the main display.

Return value

Screen position of the window content area — coordinates of the left top corner.

Math::ivec2 getClientLocalPosition ( ) const#

Returns the position of the left top corner of the window content area (without the top bar and border of the system window) in the screen coordinates. In case of several displays, the position is relative to the main display.

Return value

Screen position of the window content area — coordinates of the left top corner.

void moveToCenter ( ) #

Moves the engine window to the center of the current screen.

void setSize ( const Math::ivec2 & size ) #

Sets the engine window size.

Arguments

  • const Math::ivec2 & size - Engine window size.

Math::ivec2 getSize ( ) const#

Returns the engine window size.

Return value

Engine window size.

Math::ivec2 getClientSize ( ) const#

Returns the size of the window client (content) area.

Return value

Size of the window client area.

void setMinSize ( const Math::ivec2 & size ) #

Sets the minimum possible window size when resizing the window.

Arguments

  • const Math::ivec2 & size - Minimum possible size of the window.

Math::ivec2 getMinSize ( ) const#

Returns the minimum possible window size when resizing the window.

Return value

Minimum possible size of the window.

void setMaxSize ( const Math::ivec2 & size ) #

Sets the maximum possible window size when resizing the window..

Arguments

  • const Math::ivec2 & size - Maximum possible size of the window.

Math::ivec2 getMaxSize ( ) const#

Returns the maximum possible window size when resizing the window..

Return value

Minimum possible size of the window.

void setTitle ( const char * title ) #

Sets the text of the title for the engine window.

Arguments

  • const char * title - Title for the engine window.

const char * getTitle ( ) const#

Returns the text of the title for the engine window.

Return value

Title for the engine window.

void setIcon ( const Ptr<Image> & icon ) #

Sets the icon for the engine window.

Arguments

  • const Ptr<Image> & icon - Icon for the engine window.

Ptr<Image> getIcon ( ) #

Returns the icon for the engine window.

Return value

Icon for the engine window.

void setOpacity ( float opacity ) #

Sets the opacity for the engine window.

Arguments

  • float opacity - Opacity for the engine window.

float getOpacity ( ) const#

Returns the current opacity for the engine window.

Return value

Opacity for the engine window.

void setTitleBarEnabled ( bool enabled ) #

Enables and disables the title bar for the engine window.

Arguments

  • bool enabled - true to enable the title bar for the engine window, otherwise false.

bool isTitleBarEnabled ( ) const#

Returns the value indicating if the title bar is enabled for the engine window.

Return value

true if the title bar is enabled for the engine window, otherwise false.

void setTitleBarHeight ( int height ) #

Sets the engine window title bar height.

Arguments

  • int height - Engine window title bar height.

int getTitleBarHeight ( ) const#

Returns the engine window title bar height.

Return value

Engine window title bar height.

void setBordersEnabled ( bool enabled ) #

Enables and disables the borders for the engine window.

Arguments

  • bool enabled - true to enable the borders for the engine window, otherwise false.

bool isBordersEnabled ( ) const#

Returns the value indicating if the borders are enabled for the engine window.

Return value

true if the borders are enabled for the engine window, otherwise false.

void setBorderSize ( int size ) #

Sets the engine window border size.

Arguments

  • int size - Engine window border size.

int getBorderSize ( ) const#

Returns the engine window border size.

Return value

Engine window border size.

void setDefaultStyle ( bool style ) #

Sets the style for the engine window. The default style is as set by the operating system, the engine style is as set by the engine.

Arguments

  • bool style - true to set the default system style for the engine window, false to set the engine-style window.

bool isDefaultStyle ( ) const#

Returns the value indicating which style is set for the engine window. The default style is as set by the operating system, the engine style is as set by the engine.

Return value

true if the default system style is set for the engine window; false if the engine style is set for the window.

void setConsoleUsage ( bool usage ) #

Enables and disables usage of the console for the engine window in focus.

Arguments

  • bool usage - true to enable usage of the console for the engine window in focus, otherwise false.

bool isConsoleUsage ( ) const#

Returns the value indicating if usage of the console is enabled for the engine window.

Return value

true if usage of the console is enabled for the engine window, otherwise false.

void setProfilerUsage ( bool usage ) #

Enables and disables usage of the profiler for the engine window.

Arguments

  • bool usage - true to enable usage of the profiler for the engine window, otherwise false.

bool isProfilerUsage ( ) const#

Returns the value indicating if usage of the profiler is enabled for the engine window.

Return value

true if usage of the profiler is enabled for the engine window, otherwise false.

void setVisualizerUsage ( bool usage ) #

Enables and disables usage of the visualizer for the engine window.

Arguments

  • bool usage - true to enable usage of the visualizer for the engine window, otherwise false.

bool isVisualizerUsage ( ) const#

Returns the value indicating if usage of the visualizer is enabled for the engine window.

Return value

true if usage of the visualizer is enabled for the engine window, otherwise false.

void setResizable ( bool resizable ) #

Enables and disables the possibility to resize the engine window by the mouse.

Arguments

  • bool resizable - true to make the engine window resizable by the mouse, otherwise false.

bool isResizable ( ) const#

Returns the value indicating if the engine window is resizable by the mouse.

Return value

true if the engine window is resizable by the mouse, otherwise false.

void setResizeBorderSize ( int size ) #

Sets the size of the border that is manipulated to resize the window.

Arguments

  • int size - Size of the border that is manipulated to resize the window, in pixels.

int getResizeBorderSize ( ) const#

Returns the size of the border that is manipulated to resize the window.

Return value

Size of the border that is manipulated to resize the window, in pixels.

void setDraggableHeight ( int height ) #

Sets the height from the top of the window that is manipulated to drag the window by the mouse.

Arguments

  • int height - Height from the top of the window that is manipulated to drag the window, in pixels.

int getDraggableHeight ( ) const#

Sets the height from the top of the window that is manipulated to drag the window by the mouse.

Return value

Height from the top of the window that is manipulated to drag the window, in pixels.

void setFullscreen ( EngineWindow::FULLSCREEN_STATE state ) #

Sets the window state.

Arguments

bool isFullscreen ( ) const#

Returns the value indicating if the window is in a fullscreen state.

Return value

true if the engine window is the full-window or fullscreen state, false if it's in window mode.

EngineWindow::FULLSCREEN_STATE getFullscreenState ( ) const#

Returns the window state.

Return value

Window state.

void setFullscreenDisplayMode ( int mode ) #

Sets the mode for the current display.

Arguments

  • int mode - Fullscreen display mode, one of the mode values.

int getFullscreenDisplayMode ( ) const#

Return value

Fullscreen display mode, one of the mode values.

void show ( ) #

Enables rendering of the engine window.

bool isShown ( ) const#

Returns a value indicating if a widget is rendered.

Return value

true if the engine window is rendered, otherwise false.

void hide ( ) #

Disables rendering of the engine window.

bool isHidden ( ) const#

Returns a value indicating if a widget is hidden.

Return value

true if the engine window isn't rendered, otherwise false.

void setFocus ( ) #

Sets the focus to the engine window.

bool isFocused ( ) const#

Returns the value if the engine window is currently in focus.

Return value

true if the engine window is in focus, otherwise false.

void minimize ( ) #

Minimizes the engine window to an iconic representation.

bool isMinimized ( ) const#

Returns the value indicating if the engine window is minimized to tray.

Return value

true if the engine window is minimized, otherwise false.

void maximize ( ) #

Makes the engine window as large as possible.

bool isMaximized ( ) const#

Returns the value indicating if the engine window is maximized.

Return value

true if the engine window is maximized, otherwise false.

void restore ( ) #

Restores the size and position of the minimized or maximized engine window.

void setMouseGrab ( bool value ) #

Sets a value indicating if the mouse pointer is bound to the engine window.

Arguments

  • bool value - true if the pointer cannot leave the engine window, otherwise false.

int getHitTestResult ( ) const#

Returns a value indicating in which area of the engine window the mouse is located.

Return value

Value indicating the window area, one of the HITTEST_* values.

int getZOrder ( ) const#

Returns the order of the window. This value allows comparing which window is closer to the viewer (a relatively smaller value).

Return value

Order of the window.

void insertAfter ( const Ptr<EngineWindow> & window ) #

Places the window behind a specified window.

Arguments

  • const Ptr<EngineWindow> & window - Window behind which the current window will be placed.

void addChild ( const Ptr<Widget> & widget, int flags = -1 ) #

Adds the specified widget as a child to the client area of the engine window.

Arguments

  • const Ptr<Widget> & widget - Child widget to be added.
  • int flags - Widget flags: one of the ALIGN_* pre-defined variables. This is an optional parameter.

void removeChild ( const Ptr<Widget> & widget ) #

Removes the specified widget from the engine window.

Arguments

  • const Ptr<Widget> & widget - Child widget to be removed.

Ptr<Widget> getChild ( int index ) const#

Returns the child widget by its index.

Arguments

  • int index - Widget index.

Return value

Child widget.

int getNumChildren ( ) const#

Returns the total number of children widgets of the engine window.

Return value

Total number of children widgets.

void setGroupUsage ( bool usage ) #

Sets the value indicating if the engine window can become a group.

Arguments

  • bool usage - true to enable usage of the engine window as a group, otherwise false.

bool isGroupUsage ( ) const#

Returns the value indicating if the engine window can become a group.

Return value

true if usage of the engine window as a group is enabled, otherwise false.

void setNestedUsage ( bool usage ) #

Sets the value indicating if the engine window can be used as a nested window.

Arguments

  • bool usage - true to enable usage of the engine window as a nested window, otherwise false.

bool isNestedUsage ( ) const#

Returns the value indicating if the engine window can be used as a nested window.

Return value

true if usage of the engine window as a nested window is enabled, otherwise false.

int getNumNestedWindows ( ) const#

Returns the total number of nested windows in the group.

Return value

Total number of nested windows in the group.

Ptr<EngineWindow> getNestedWindow ( int index ) const#

Returns the nested engine window by its index.

Arguments

  • int index - Index of the nested window.

Return value

Nested engine window.

int getNestedWindowIndex ( const Ptr<EngineWindow> & window ) #

Returns the index of the specified nested engine window.

Arguments

  • const Ptr<EngineWindow> & window - Nested engine window.

Return value

Index of the nested window.

bool containsNestedWindow ( const Ptr<EngineWindow> & window ) const#

Returns the value indicating if the specified window is a direct child of the current window.

Arguments

  • const Ptr<EngineWindow> & window - Window to be checked.

Return value

true if the specified window is a direct child of the current one, otherwise false.

bool containsNestedWindowGlobal ( const Ptr<EngineWindow> & window ) const#

Returns the value indicating if the specified window is a child of the current window or any of its children.

Arguments

  • const Ptr<EngineWindow> & window - Window to be checked.

Return value

true if the specified window is a child of the current one, otherwise false.

Ptr<EngineWindow> getParentGroup ( ) const#

Returns the group into which the current window is nested, or nullptr if it's a separate window.

Return value

Group into which the current window is nested, or nullptr if it's a separate window.

Ptr<EngineWindow> getGlobalParentGroup ( ) const#

Returns the top group of the hierarchy into which the current window is nested, or nullptr if it's a separate window.

Return value

Top group of the hierarchy into which the current window is nested, or nullptr if it's a separate window.

bool isGlobalChildOf ( const Ptr<EngineWindow> & window ) #

Returns the value specifying if the current window is a part of a hierarchy of the specified window.

Arguments

  • const Ptr<EngineWindow> & window - Window to be checked.

Return value

true if the current window is globally a child of the specified one, otherwise false.

int getCurrentTab ( ) const#

Returns the index of the currently active tab in a tab group.

Return value

Index of the currently active tab.

int getTabWidth ( int index ) const#

Returns the width of the tab.

Arguments

  • int index - Index of the tab.

Return value

Width of the the tab.

int getTabHeight ( int index ) const#

Returns the height of the tab.

Arguments

  • int index - Index of the tab.

Return value

Height of the tab.

int getTabBarWidth ( int index ) const#

Returns the width of the tab bar.

Arguments

  • int index - Index of the tab.

Return value

Width of the tab bar.

int getTabBarHeight ( int index ) const#

Returns the height of the tab bar.

Arguments

  • int index - Index of the tab.

Return value

Height of the tab bar.

Math::ivec2 getTabLocalPosition ( int index ) const#

Returns the screen position of the tab relatively to the parent group (global window). The coordinates represent the displacement from the top left corner of the parent group (global window).

Arguments

  • int index - Index of the tab.

Return value

Screen position of the tab relatively to the parent group (global window).

Math::ivec2 getTabBarLocalPosition ( int index ) const#

Returns the screen position of the tab bar relatively to the parent group (global window). The coordinates represent the displacement from the top left corner of the parent group (global window).

Arguments

  • int index - Index of the tab.

Return value

Screen position of the tab bar relatively to the parent group (global window).

void setHorizontalTabWidth ( int index, int width ) #

Sets the width of the tab in the group of tabs arranged horizontally.

Arguments

  • int index - Index of the tab.
  • int width - Width of the tab in the group of tabs arranged horizontally.

void setVerticalTabHeight ( int index, int height ) #

Sets the height of the tab in the group of tabs arranged vertically.

Arguments

  • int index - Index of the tab.
  • int height - Height of the tab in the group of tabs arranged vertically.

void setSeparatorPosition ( int index, int pos ) #

Sets the position of the line separating a tab group from the rest of the area. The separator line can be horizontal or vertical depending on the group type.

Arguments

  • int index - Index of the tab.
  • int pos - Position of the separation line, in pixels, from the top-left corner of the window.

int getSeparatorPosition ( int index ) const#

Returns the position of the line separating a tab group from the rest of the area. The separator line can be horizontal or vertical depending on the group type.

Arguments

  • int index - Index of the tab.

Return value

Position of the separation line, in pixels, from the top-left corner of the window.

void setSeparatorValue ( int index, float value ) #

Sets the size of the tab separator.

Arguments

  • int index - Index of the tab.
  • float value - Size of the tab separator.

float getSeparatorValue ( int index ) const#

Returns the size of the tab separator.

Arguments

  • int index - Index of the tab.

Return value

Size of the tab separator.

void swapTabs ( int first, int second ) #

Swaps the specified tabs.

Arguments

  • int first - Index of the first tab.
  • int second - Index of the second tab.

bool isHover ( const Math::ivec2 & global_mouse_pos ) const#

Returns the value indicating if the mouse is hovering over the window.

Arguments

  • const Math::ivec2 & global_mouse_pos - Global screen coordinates of the mouse relative to the main display.

Return value

true if the mouse hovers over the current window, otherwise false.

bool isClientHover ( const Math::ivec2 & global_mouse_pos ) const#

Returns the value indicating if the mouse is hovering over the client area of the window.

Arguments

  • const Math::ivec2 & global_mouse_pos - Global screen coordinates of the mouse relative to the main display.

Return value

true if the mouse hovers over the client area of the window, otherwise false.

int getHoverTabBar ( const Math::ivec2 & global_mouse_pos, Math::ivec2 & out_bar_pos, Math::ivec2 & out_bar_size ) const#

Returns the index of the tab over the bar of which the mouse hovers.

Arguments

  • const Math::ivec2 & global_mouse_pos - Global screen coordinates of the mouse relative to the main display.
  • Math::ivec2 & out_bar_pos - Position of the tab bar.
  • Math::ivec2 & out_bar_size - Size of the tab bar.

Return value

Index of the tab.

int getHoverTabBarArea ( const Math::ivec2 & global_mouse_pos, Math::ivec2 & out_area_pos, Math::ivec2 & out_area_size ) const#

Returns the index of the tab over the bar area of which the mouse hovers.

Arguments

  • const Math::ivec2 & global_mouse_pos - Global screen coordinates of the mouse relative to the main display.
  • Math::ivec2 & out_area_pos
  • Math::ivec2 & out_area_size

Return value

Index of the tab.

int getNumDroppedItems ( ) const#

Returns the total number of files and/or folders dropped to the window.

Return value

Number of dropped files and/or folders.

const char * getDroppedItem ( int index ) #

Returns the absolute path to the file or folder dropped to the window.

Arguments

  • int index - Index of the dropped file or folder.

Return value

Absolute path to the dropped file or folder.
Last update: 2022-08-08
Build: ()