This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Professional (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Materials and Shaders
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
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
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Сэмплы материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Unigine::Gui Class

Header: #include <UnigineGui.h>

Creates a GUI. Different types of GUI widgets can be either added to one of the following:

  • To the system GUI (Unigine user interface) that is rendered on top of application window.
  • To the GUI object positioned in the world. In this case, any postprocessing filter can be applied.
Default values returned by the following methods can be overridden via RC files defining a custom GUI.

Gui Class

Enums

CALLBACK_INDEX#

NameDescription
SHOW = 0Callback is used when a widget is shown. Supported by all widgets.
HIDE = 1Callback is used when a widget is removed via Gui::removeChild(). Supported by all widgets.
FOCUS_IN = 2Callback is used when a widget is focused. Supported by all widgets.
FOCUS_OUT = 3Callback is used when a widget loses focus. Supported by all widgets.
CHANGED = 4Callback is used when a widget has changed its state. Supported by the following widgets:
CLICKED = 5Callback is used when the mouse is clicked somewhere on a widget. Supported by the following widgets:
DOUBLE_CLICKED = 6Callback is used when the mouse is double-clicked somewhere on a widget. Supported by the following widgets:
PRESSED = 7Callback is used when a mouse button or ENTER (RETURN) is pressed, while the mouse pointer is somewhere on a widget. Supported by the following widgets:
RELEASED = 8Callback is used when the mouse was released after clicking somewhere on a widget. Supported by the following widgets:
KEY_PRESSED = 9Callback us used when a key (by scan code) is pressed while a widget is in focus. Supported by the following widgets:

Scan code - is a code assigned to avery key on the keyboard. Keyboard drivers use scan codes to detect which key is pressed. Scan codes are assigned to leys on the hardware level and are not affected by the states of modifiers like Caps Lock, Num Lock, Scroll Lock, Shift, Alt, and Ctrl making it possible to implement identical control on different types of keyboards (QWERTY, AZERTY, QWERTC, etc.). Scan codes are used when only a physical position of a key (a button) is important (e.g. in the ControlsApp class or Console key.

TEXT_PRESSED = 10Callback us used when a virtual key is pressed while a widget is in focus. Supported by the following widgets:

Virtual key - is a value to which a scan code was converted by an Operating System (e.g., the Q scan code will have the Q virtual key on a QWERTY-keyboard, while on an AZERTY-keyboard it will have the A virtual key; or NUMPAD_DIGIT_7 scan code can be translated into virtual NUMPAD_HOME or NUMPAD_DIGIT_7 depending on the current Num Lock state. Virtual keys are used, when it is important to know what exactly did user type (not just the physical button, but rather a letter).

ENTER = 11Callback is used when the mouse pointer enters a widget. Supported by all widgets.
LEAVE = 12Callback is used when the mouse pointer leaves a widget. Supported by all widgets.
DRAG_MOVE = 13Callback is used when a focused widget is moved.
DRAG_DROP = 14Callback is used when a drag-and-drop operation is performed with a widget. Supported by all widgets. A callback can receive dragged widgets inside additional arguments. Clicked or pressed callbacks receive a mouse button or a key inside an additional callback argument.
REMOVE = 15Callback is used when a widget is removed.
NUM_CALLBACKS = 16Number of GUI callbacks.

Members


Ptr<Gui> getCurrent ( ) #

Returns the current GUI instance.

Return value

Current GUI instance.

bool isActive ( ) const#

Returns a value indicating if any widget in the GUI is in focus.

Return value

true if any widget is focused; otherwise, false.

Ptr<Widget> getChild ( int num ) const#

Returns a child widget with a given number.

Arguments

  • int num - Child widget number.

Return value

Child widget.

int isChild ( const Ptr<Widget> & widget ) const#

Checks if a given widget belongs to the GUI.

Arguments

  • const Ptr<Widget> & widget - Widget to check.

Return value

true if the widget belongs to the GUI; otherwise, false.

void setColor ( const Math::vec4 & color ) #

Sets a color for the global color multiplier. The default is equivalent to #ffffff (white).

Arguments

  • const Math::vec4 & color - Color multiplier.

Math::vec4 getColor ( ) const#

Returns the color of the global color multiplier.

Return value

Color multiplier.

void setDefaultAlpha ( float alpha ) #

Sets a standard alpha value for widgets.

Arguments

  • float alpha - Alpha value. 0 means completely transparent.

float getDefaultAlpha ( ) const#

Returns the standard alpha value of a widget.

Return value

Alpha value.

void setDefaultColor ( const Math::vec4 & color ) #

Sets a standard font color for widgets. The default is equivalent to #ddddff (blue-white).

Arguments

  • const Math::vec4 & color - Font color.

Math::vec4 getDefaultColor ( ) const#

Returns the standard font color of a widget.

Return value

Font color.

void setDefaultSize ( int size ) #

Sets a standard font size for widgets.

Arguments

  • int size - Font size.

int getDefaultSize ( ) const#

Returns the standard font size of a widget.

Return value

Font size.

void setDisabledAlpha ( float alpha ) #

Sets an alpha value for disabled widgets.

Arguments

  • float alpha - Alpha value. 0 means completely transparent.

float getDisabledAlpha ( ) const#

Returns the alpha value of a disabled widget.

Return value

Alpha value.

void setDisabledColor ( const Math::vec4 & color ) #

Sets a font color for disabled widgets. The default is equivalent to #869caa (light bluish).

Arguments

  • const Math::vec4 & color - Font color.

Math::vec4 getDisabledColor ( ) const#

Returns the font color of a disabled widget.

Return value

Font color.

void setDisabledEnabled ( bool enabled ) #

Sets a value indicating if a widget can be rendered as disabled (i.e. change its color accordingly), when necessary.

Arguments

  • bool enabled - Positive value if the widget can be rendered as disabled; otherwise, 0.

bool isDisabledEnabled ( ) const#

Returns a value indicating if a widget can be rendered as disabled (i.e. change its color accordingly), when necessary.

Return value

1 if the widget can be rendered as disabled; otherwise, 0.

void setEnabled ( bool enabled ) #

Sets a value indicating if a widget should be enabled/disabled.

Arguments

  • bool enabled - 1 to enable the GUI, 0 to disable it.

bool isEnabled ( ) const#

Returns a value indicating if the GUI is enabled.

Return value

Return 1 if the GUI is enabled; otherwise, 0 is returned.

void setExposeSpeed ( float speed ) #

Sets a duration of animation played when the widget appears.

Arguments

  • float speed - Duration in cycles per second, for example, 6 means that the duration is a 1/6 of a second.

float getExposeSpeed ( ) const#

Returns the duration of animation played when a widget appears.

Return value

Duration in cycles per second.

void setFadeInSpeed ( float speed ) #

Sets a duration of fade-in animation played when the widget gets focused.

Arguments

  • float speed - Duration in cycles per second, for example, 8 means that the duration is a 1/8 of a second.

float getFadeInSpeed ( ) const#

Returns the duration of fade-in animation played when a widget gets focused.

Return value

Duration in cycles per second.

void setFadeOutSpeed ( float speed ) #

Sets a duration of fade-out animation played when the widget loses focus.

Arguments

  • float speed - Duration in cycles per second, for example, 4 means that the duration is a 1/4 of a second.

float getFadeOutSpeed ( ) const#

Returns the duration of fade-out animation played when a widget loses focus.

Return value

Duration in cycles per second.

Ptr<Widget> getFocus ( ) const#

Returns the widget that is currently in focus.

Return value

Focused widget smart pointer.

void setFocusedAlpha ( float alpha ) #

Sets an alpha value for focused widgets. The default is 1 (completely opaque).

Arguments

  • float alpha - Alpha value. 0 means completely transparent.

float getFocusedAlpha ( ) const#

Returns the alpha value of a focused widget.

Return value

Alpha value.

void setFocusedColor ( const Math::vec4 & color ) #

Sets an font color for focused widgets. The default is equivalent to #ffffff (white).

Arguments

  • const Math::vec4 & color - Font color.

Math::vec4 getFocusedColor ( ) const#

Returns the font color of a focused widget.

Return value

Font color.

void setFocusedEnabled ( bool enabled ) #

Sets a value indicating if a widget can be rendered as focused on (i.e. change its color accordingly), when necessary.

Arguments

  • bool enabled - Positive value if the widget can be rendered as focused on; otherwise, 0.

bool isFocusedEnabled ( ) const#

Returns a value indicating if a widget can be rendered as focused on (i.e. change its color accordingly), when necessary.

Return value

1 if the widget can be rendered as focused on; otherwise, 0.

void setFocusedPermanent ( bool permanent ) #

Changes the permanent color of the focused widget.

Arguments

  • bool permanent - 1 - a font color is overridden with the global GUI focused color; 0 - a font color is unchanged.

bool isFocusedPermanent ( ) const#

Returns a value indicating if the permanent color of the focused widget is changed.

Return value

1 if the font color is overridden with the global GUI focused color; 0 if the font color is unchanged.

int setFont ( const char * name ) #

Changes the font used in the system GUI.

Arguments

  • const char * name - Path to the font file.

Return value

1 if the font is successfully changed; otherwise, 0.

int getHeight ( ) const#

Returns the current screen height.

Return value

Screen height, in pixels.

void setHidden ( bool hidden ) #

Sets a value indicating if a widget should not be rendered.

Arguments

  • bool hidden - 1 to show the GUI, 0 to hide it.

bool isHidden ( ) const#

Returns a value indicating if a widget is rendered visible.

Return value

1 if the widget is rendered; otherwise, 0.

int getKeyActivity ( unsigned int key ) const#

Checks if a given key already has a special purpose for the widget in focus.

Arguments

  • unsigned int key - One of the standard ASCII control codes or one of the KEY_* pre-defined variables.

Return value

1 if the key cannot be used; otherwise, 0.

void setMouseButtons ( int buttons ) #

Sets mouse button(s), whose input should be received.

Arguments

int getMouseButtons ( ) const#

Returns mouse button(s), whose input is received.

Return value

Input::MOUSE_BUTTON_LEFT or Input::MOUSE_BUTTON_RIGHT, or Input::MOUSE_BUTTON_MIDDLE.

void setMouseCursor ( int cursor ) #

Sets a mouse pointer to display.

Arguments

  • int cursor - One of the CURSOR_* pre-defined variables.

int getMouseCursor ( ) const#

One of the CURSOR_* pre-defined variables.

Return value

Returns the type of mouse pointer currently displayed.

int getMouseDX ( ) const#

Returns the difference between the previous position of the mouse pointer and the current one along the X axis.

Return value

Difference along the X axis.

int getMouseDY ( ) const#

Returns the difference between the previous position of the mouse pointer and the current one along the Y axis.

Return value

Difference along the Y axis.

void setMouseEnabled ( bool enabled ) #

Enables or disables rendering of the mouse cursor.

Arguments

  • bool enabled - 1 to enable the mouse, 0 to disable it.

bool isMouseEnabled ( ) const#

Returns a value indicating if the mouse cursor is rendered.

Return value

1 if the mouse is rendered; otherwise, 0.

void setMouseGrab ( int grab ) #

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

Arguments

  • int grab - 1 if the mouse pointer cannot leave the GUI; otherwise, 0.

int getMouseGrab ( ) const#

Returns a value indicating if the mouse pointer is bound to the GUI.

Return value

1 if the mouse pointer cannot leave the GUI; otherwise, 0.

void setMouseSprite ( const Ptr<WidgetSprite> & sprite ) #

Sets a custom mouse pointer.

Arguments

  • const Ptr<WidgetSprite> & sprite - Sprite with a custom mouse pointer, or NULL to fall back to the standard mouse pointer.

Ptr<WidgetSprite> getMouseSprite ( ) const#

Returns the custom mouse pointer currently in use.

Return value

Sprite with a custom mouse pointer, or NULL if the standard mouse pointer is used.

int getMouseX ( ) const#

Returns the current X coordinate of the mouse pointer in the coordinate system of the application window.

Return value

X coordinate of the mouse pointer.

int getMouseY ( ) const#

Returns the current Y coordinate of the mouse pointer in the coordinate system of the application window.

Return value

Y coordinate of the mouse pointer.

int getNumChildren ( ) const#

Returns the number of widgets in the GUI.

Return value

Number of widgets.

Ptr<Widget> getOverlappedFocus ( ) const#

Returns the widget placed under the currently focused widget.

Return value

Overlapped widget.

Ptr<Widget> getPermanentFocus ( ) const#

Returns a widget that is always in focus.

Return value

Widget always in focus.

int setResource ( const char * name ) #

Changes the resource skin file used in the system GUI.

Arguments

  • const char * name - Path to the rc file.

Return value

1 if the resource file is successfully changed; otherwise, 0.

int setSkin ( const char * name ) #

Changes the GUI skin used in the system GUI.

Arguments

  • const char * name - Path to the skin file (an RC file and textures).

Return value

1 if the skin is successfully changed; otherwise, 0.

void setToolTip ( int x, int y, const char * str ) #

Sets a tooltip.

Arguments

  • int x - X coordinate of the tooltip position.
  • int y - Y coordinate of the tooltip position.
  • const char * str - ToolTip text.

void setToolTipAlpha ( float alpha ) #

Sets an alpha value for tooltips. The default is 0.95 (translucent).

Arguments

  • float alpha - Alpha value. 0 means completely transparent.

float getToolTipAlpha ( ) const#

Returns the alpha value of a tooltip.

Return value

Alpha value.

void setToolTipColor ( const Math::vec4 & color ) #

Sets a font color for tooltips. The default is equivalent to #000000 (black).

Arguments

  • const Math::vec4 & color - Font color.

Math::vec4 getToolTipColor ( ) const#

Returns the font color of a tooltip.

Return value

Font color.

void setToolTipEnabled ( bool enabled ) #

Sets a value indicating whether tooltips are available or not.

Arguments

  • bool enabled - 1 to enable tooltips; otherwise, 0.

bool isToolTipEnabled ( ) const#

Returns a value indicating if tooltips are available or not.

Return value

Return 1 if tooltips are enabled; otherwise, 0.

int getToolTipHeight ( const char * str ) const#

Returns a height of the given tooltip.
Notice
Height of a single-line tooltip is equal to 21 pixels.

Arguments

  • const char * str - A tooltip text.

Return value

Height of the given tooltip (in pixels).

void setToolTipSize ( int size ) #

Sets a font size for widgets.

Arguments

  • int size - Font size.

int getToolTipSize ( ) const#

Returns the font size of a tooltip.

Return value

Font size.

void setToolTipText ( const char * text ) #

Sets a new text for the tooltip.

Arguments

  • const char * text - Text for the tooltip to be set.

const char * getToolTipText ( ) const#

Returns the text of the currently displayed tooltip.

Return value

Text of the GUI tooltip.

void setToolTipTime ( float time ) #

Sets a delay before tooltip appearance.

Arguments

  • float time - Delay in cycles per second.

float getToolTipTime ( ) const#

Returns the delay before tooltip appearing.

Return value

Delay in cycles per second.

void setToolTipWidth ( int width ) #

Sets the width for the tooltip.

Arguments

  • int width - New tooltip width.

int getToolTipWidth ( const char * str ) const#

Returns the current width of the tooltip.

Arguments

  • const char * str - A tooltip text.

Return value

Width of the tooltip.

int getToolTipWidth ( ) const#

Returns the current width of the tooltip.

Return value

Width of the tooltip.

void setToolTipX ( int tooltipx ) #

Sets the ToolTip position along the X axis.

Arguments

  • int tooltipx - New X coordinate of the ToolTip to be set.

int getToolTipX ( ) const#

Returns the ToolTip position along the X axis.

Return value

X coordinate of the ToolTip.

void setToolTipY ( int tooltipy ) #

Sets the ToolTip position along the Y axis.

Arguments

  • int tooltipy - New Y coordinate of the ToolTip to be set.

int getToolTipY ( ) const#

Returns the ToolTip position along the Y axis.

Return value

void setTransform ( const Math::mat4 & transform ) #

Sets the global GUI transformation matrix. This 2D matrix can be tilted, rotated, moved or modified in many ways in 3D space.

Arguments

  • const Math::mat4 & transform - Transformation matrix.

Math::mat4 getTransform ( ) const#

Returns the global GUI transformation matrix.

Return value

GUI transformation matrix.

void setTransparentAlpha ( float alpha ) #

Sets an alpha value for transparent widgets. A widget is transparent, if it uses blending. The default is 0.8 (translucent).

Arguments

  • float alpha - Alpha value. 0 means completely transparent.

float getTransparentAlpha ( ) const#

Returns the alpha value of a transparent widget. A widget is transparent, if it uses blending.

Return value

Alpha value.

void setTransparentColor ( const Math::vec4 & color ) #

Sets a font color for transparent widgets. A widget is transparent, if it uses blending. The default is equivalent to #869caa (light bluish).

Arguments

  • const Math::vec4 & color - Font color.

Math::vec4 getTransparentColor ( ) const#

Returns the font color of a transparent widget. A widget is transparent, if it uses blending.

Return value

Font color of a transparent widget.

void setTransparentEnabled ( bool enabled ) #

Sets a value indicating if a widget can be rendered as transparent (i.e. change its color accordingly), when necessary. For example, this function allows to control whether the drop-down list of combobox is transparent or not.

Arguments

  • bool enabled - Positive value if the widget can be rendered as transparent; otherwise, 0.

bool isTransparentEnabled ( ) const#

Returns a value indicating if a widget can be rendered as transparent (i.e. change its color accordingly), when necessary. For example, it can indicate whether the drop-down list of combobox is transparent or not.

Return value

1 if the widget can be rendered as transparent; otherwise, 0.

int getWidth ( ) const#

Returns the current screen width.

Return value

Screen width, in pixels.

Ptr<WidgetVBox> getVBox ( ) const#

Returns the root widget of the GUI (WidgetVBox).

Return value

The root widget of the GUI.

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

Adds a given widget to the GUI.

Arguments

  • const Ptr<Widget> & widget - Widget to add.
  • int flags - One of the ALIGN_* pre-defined variables. This is an optional parameter.

int addDictionary ( const char * name, const char * language = 0 ) #

Adds a new dictionary with localized interface strings. Dictionaries cannot be modified in run-time.

Arguments

  • const char * name - Path to the dictionary file.
  • const char * language - Name of the dictionary language.

Return value

Returns 1 if the dictionary is added successfully; otherwise, 0.

void clearDictionaries ( ) #

Clears all dictionaries.

int clearTexture ( const char * name ) #

Clears the specified GUI texture file cache.

Arguments

  • const char * name - Texture name.

Return value

1 if the texture is successfully cleared; otherwise, 0.

Ptr&lt;Gui&gt; create ( const char * name = 0 ) #

GUI constructor.

Arguments

  • const char * name - GUI skin name.

Return value

Pointer to the created GUI.

void destroy ( ) #

Destroys all GUI resources.

void disable ( ) #

Disables GUI rendering.

void enable ( ) #

Enables GUI rendering.

int hasTranslation ( const char * arg1 ) const#

Returns a value indicating if there is translation for a given string in the localization dictionary.

Arguments

  • const char * arg1 - String to check.

Return value

1 if there is translation for the given string; otherwise, 0.

Math::vec4 parseColor ( const char * str ) const#

Converts a color string in the Web format (RRGGBB / #RRGGBB or RRGGBBAA / #RRGGBBAA) into its vec4 equivalent.

Arguments

  • const char * str - Color string in the Web format.

Return value

Color value as a vec4 vector (R, G, B, A).

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

Removes the specified widget from the GUI.

Arguments

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

void removeFocus ( ) #

Removes focus from the GUI.

void render ( ) #

Renders the GUI.

void render ( int custom_mouse_buttons ) #

Renders the GUI.

Arguments

  • int custom_mouse_buttons - Pressed mouse button.

void replaceChild ( const Ptr<Widget> & widget, const Ptr<Widget> & old_widget, int flags = 0 ) #

Replaces a given widget in the GUI with another widget.

Arguments

  • const Ptr<Widget> & widget - Replacement widget.
  • const Ptr<Widget> & old_widget - Widget to be replaced.
  • int flags - One of the ALIGN_* pre-defined variables. This is an optional parameter.

int saveDictionary ( const char * name, const char * language = 0 ) #

Saves the current dictionary on disk. This function can be used to save the currently loaded dictionary into another file.

Arguments

  • const char * name - Name of the dictionary language.
  • const char * language - Dictionary language name.

Return value

1 if the dictionary is saved successfully; otherwise, 0.

const char * translate ( const char * str ) #

Returns the source string translated using the dictionary.

Arguments

  • const char * str - String to translate (source).

Return value

Target (translated) string if it is found in the localization dictionary; otherwise, the source string.

void update ( ) #

Updates GUI.

bool isRenderingBootScreen ( ) #

Returns a value indicating if the GUI currently renders the boot screen.

Return value

true if the GUI currently renders the boot screen; otherwise, false.

bool isRenderingSplashScreen ( ) #

Returns a value indicating if the GUI currently renders the splash screen.

Return value

true if the GUI currently renders the splash screen; otherwise, false.

bool isRenderingLoadingScreen ( ) #

Returns a value indicating if the GUI currently renders the loading screen.

Return value

true if the GUI currently renders the loading screen; otherwise, false.

void focusGained ( ) #

The focus is set on the GUI object.

void focusLost ( ) #

The focus is removed from the GUI.

bool isHover ( int global_pos_x, int global_pos_y ) const#

Returns a value indicating if the cursor is hovering over the GUI object.

Arguments

  • int global_pos_x - The X coordinate of the cursor in global coordinates.
  • int global_pos_y - The Y coordinate of the cursor in global coordinates.

Return value

true if the cursor is hovering over the GUI object; otherwise, false.

Ptr<Widget> getWidgetIntersection ( int global_pos_x, int global_pos_y ) #

Returns the intersected widget that is visually perceptible (not empty, not transparent).

Arguments

  • int global_pos_x - The X coordinate of the cursor in global coordinates.
  • int global_pos_y - The Y coordinate of the cursor in global coordinates.

Return value

The intersected widget that is visually perceptible.

Ptr<Widget> getUnderCursorWidget ( ) #

Returns the visually perceptible widget, over which the cursor is currently hovering.

Return value

The widget, over which the cursor is currently hovering.

Ptr<Gui> getFocusGui ( ) #

Returns the GUI object that is currently in focus.

Return value

The GUI object currently in focus.

Ptr<Gui> getGuiIntersection ( int global_pos_x, int global_pos_y ) #

Returns the intersected GUI object.
Notice
This method takes Z-ordering into consideration: if the GUI object is overlapped by any other window, the method returns nullptr.

Arguments

  • int global_pos_x - The X coordinate of the intersection point in global coordinates.
  • int global_pos_y - The Y coordinate of the intersection point in global coordinates.

Return value

The intersected GUI object.

Ptr<Gui> getUnderCursorGui ( ) #

Returns the GUI object that is currently under cursor.
Notice
If case of dragging or resizing a window, this method returns nullptr. To receive the intersected GUI in such a case, use getGuiIntersection().

Return value

GUI object currently under cursor.

void getWorldGuiInstances ( Vector<Ptr<Gui>> & ret_instances ) #

Returns all GUI instances that are available in the scene hierarchy and rendered as world objects.

Arguments

  • Vector<Ptr<Gui>> & ret_instances - All GUI instances that are available in the scene hierarchy and rendered as world objects.

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

Sets the GUI object size.

Arguments

  • const Math::ivec2 & size - GUI object size (width and height).

Math::ivec2 getSize ( ) const#

Returns the GUI object size.

Return value

GUI object size (width and height).

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

Sets the GUI object position (top left corner) in screen coordinates.

Arguments

  • const Math::ivec2 & position - GUI object position.

Math::ivec2 getPosition ( ) const#

Sets the GUI object position (top left corner) in screen coordinates.

Return value

GUI object position.

void setWinHandle ( unsigned long long handle ) #

Sets the engine handle of the window.

Arguments

  • unsigned long long handle - The window handle.

unsigned long long getWinHandle ( ) const#

Returns the engine handle of the window.

Return value

The window handle.

void setWorldObject ( bool val ) #

Sets the value indicating if the GUI object is available in the hierarchy and rendered as a world object.

Arguments

  • bool val - true if the GUI object should be available in the hierarchy and rendered as a world object; false if it should have the window handle.

bool isWorldObject ( ) const#

Returns the value indicating if the GUI object is available in the hierarchy and rendered as a world object.

Return value

true if the GUI object is available in the hierarchy and rendered as a world object; false if it has the window handle.

void setMouseShow ( bool show ) #

Sets the value indicating if the OS mouse pointer should be displayed.

Arguments

  • bool show - true if the OS mouse pointer should be displayed; false if the application cursor is used only.

bool isMouseShow ( ) const#

Returns the value indicating if the OS mouse pointer should be displayed.

Return value

true if the OS mouse pointer is displayed; false if the application cursor is used only.

int getMouseWheel ( ) const#

Returns the current mouse scroll value. Negative values correspond to scrolling downwards; positive values correspond to scrolling upwards; the value is zero when the mouse wheel is not scrolled.

Return value

The mouse scroll value in the [-1;1] range.

int getAndClearMouseWheel ( ) #

Returns the mouse scroll value and clears the mouse scroll state info.

Return value

The mouse scroll value in the [-1;1] range.

void forceSetMouseWheel ( int value ) #

Sets the mouse scroll value.

Arguments

  • int value - The mouse scroll value in the [-1;1] range.

int getMouseWheelHorizontal ( ) const#

Returns the current horizontal mouse scroll value.

Return value

The horizontal mouse scroll value in the [-1;1] range.

int getAndClearMouseWheelHorizontal ( ) #

Returns the mouse horizontal scroll value and clears the mouse scroll state info.

Return value

The horizontal mouse scroll value in the [-1;1] range.

void forceSetMouseWheelHorizontal ( int value ) #

Sets the mouse vertical scroll value.

Arguments

  • int value - The horizontal mouse scroll value in the [-1;1] range.

bool isUnderCursor ( ) const#

Returns the value indicating if the GUI object is under cursor.

Return value

true if the GUI object is under cursor; otherwise, false.

bool getKey ( Input::KEY key ) #

Returns the value indicating if the specified key is pressed.

Arguments

  • Input::KEY key - One of the standard ASCII control codes or one of the KEY_* pre-defined variables.

Return value

true if the key is pressed; otherwise, false.

bool getAndClearKey ( Input::KEY key ) #

Returns the value indicating if the specified key is pressed and clears the key state info.

Arguments

  • Input::KEY key - One of the standard ASCII control codes or one of the KEY_* pre-defined variables.

Return value

true if the key is pressed; otherwise, false.
Last update: 12.10.2022
Build: ()