Unigine.EngineWindowViewport Class
Inherits from: | EngineWindow |
The class to create and manage window viewports: setting cameras, specifying engine tools available (console, profiler, visualizer, etc.), add widgets to the client area.
To create an engine window viewport, use one of the class constructors:
Source code (C#)
// create an engine window of the specified size with the specified name
EngineWindowViewport window = new EngineWindowViewport("Window", 580, 300);
Then you can specify behavior of the window viewport and add widgets to its client area:
Source code (C#)
// set the window viewport as the main one
window.Main = true;
// enable the console, profiler and visualizer for the window viewport
window.ConsoleUsage = true;
window.setProfilerUsage = true;
window.setVisualizerUsage = true;
// add widgets to the client area
window.AddChild(new WidgetLabel(window.SelfGui, String.Format("This is {0} window.", window.Title)));
window.AddChild(new WidgetButton(window.SelfGui, window.Title), Gui.ALIGN_CENTER);
EngineWindowViewport Class
Properties
Viewport Viewport#
The window viewport.
Camera Camera#
The camera the image from which is rendered to the engine window viewport. This value has a higher priority over the main camera flag.
bool Main#
The value indicating if the window is the main window.
bool ConsoleUsage#
The value indicating if the console is displayed for the window currently in focus.
bool ProfilerUsage#
The value indicating if the profiler is displayed for the window currently in focus.
bool VisualizerUsage#
The value indicating if the visualizer is displayed for the window currently in focus.
bool SkipRenderEngine#
The value indicating whether the Engine rendering for the current window is disabled (even if it has the main camera flag or the user camera set). This doesn't disable the Gui instance, so widgets and the console remain available.
bool IsFullscreen#
The value indicating if the engine window is the fullscreen state.
bool MouseGrab#
The value indicating if the mouse pointer is bound to the engine window viewport.
int NumChildren#
The total number of children widgets.
Members
EngineWindowViewport ( ivec2 size, int flags = 0 ) #
Constructor. Creates the window viewport of the specified size with the specified flags.Arguments
EngineWindowViewport ( int width, int height, int flags = 0 ) #
Constructor. Creates the window viewport of the specified size with the specified flags.Arguments
- int width - Window width.
- int height - Window height.
- int flags - Mask containing window flags.
EngineWindowViewport ( string window_title, int width, int height, int flags = 0 ) #
Constructor. Creates the window viewport of the specified size with the specified title and flags.Arguments
- string window_title - The title of the window, in UTF-8 encoding.
- int width - Window width.
- int height - Window height.
- int flags - Mask containing window flags.
void SetSkipRenderEngine ( bool engine ) #
Disables the Engine rendering for the current window (even if it has the main camera flag or the user camera set). This doesn't disable the Gui instance, so widgets and the console remain available.Arguments
- bool engine - true to disable rendering, false to enable it.
bool IsSkipRenderEngine ( ) #
Returns the value indicating whether the Engine rendering is disabled.Return value
true if the Engine rendering is disabled; otherwise, false.void DisableFullscreen ( ) #
Disables the fullscreen mode for the window in the fullscreen mode and sets the focus to this window. States and positions of other windows are restored.Notice
This method can't be applied to nested windows.
bool EnableFullscreen ( int display = -1, int mode = -1 ) #
Enables the specified fullscreen mode for the specified display. The states of other displayed windows are stored in order to restore their states and positions when the fullscreen mode is disabled. A nested window will be withdrawn from the group if set to fullscreen.Arguments
- int display - Display index.
- int mode - Index of the mode supported by the display.
Return value
true if the specified fullscreen mode has been enabled for the specified display; otherwise, false.void SetMouseGrab ( bool value ) #
Sets a value indicating if the mouse pointer is bound to the engine window viewport.Notice
This method can be applied to a separate or parent window, using this method for a nested window is not allowed.
Arguments
- bool value - true if the pointer cannot leave the engine window viewport, otherwise false.
void AddChild ( Widget widget, int flags = -1 ) #
Adds the specified widget as a child to the client area of the engine window.Arguments
- 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 ( Widget widget ) #
Removes the specified widget from the engine window.Arguments
- Widget widget - Child widget to be removed.
Widget GetChild ( int index ) #
Returns the child widget by its index.Arguments
- int index - Widget index.
Return value
Child widget.int GetNumChildren ( ) #
Returns the total number of children widgets of the engine window.Return value
The total number of children widgets.bool IsChild ( Widget widget ) #
Checks if the argument widget is the child of the current window viewport.Arguments
- Widget widget - Widget.
Return value
true if the widget is the child of the current window viewport; otherwise, false.Last update:
2023-06-23
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)