This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
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 Objects
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-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
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.

Unigine.App Class

The App class contains functions to control the Unigine application graphic context, which includes:

  • Update parameters
  • Events of the controls (keyboard, mouse)
  • FPS
  • Window parameters (height, width, name, etc.)

The class is used, for example, when you need to get and manage user input.

Usage Example#

The following examples perform:

  • Changing parameters of the application window (such as title). The specified changes are applied after application start-up. It means that the window with default settings will appear first. If you need the custom settings are applied before the application window is displayed, you should implement your own class inherited from the App class.
  • Processing user inputs.
  • Updating the application in background.

Changing Window Parameters#

AppSystemLogic.cs

Source code (C#)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

using Unigine;

namespace UnigineApp
{
	class AppSystemLogic : SystemLogic
	{

		public AppSystemLogic()
		{
		}

		public override bool Init()
		{
			// change window title
			App.setTitle("Custom Window Title");
			
			return true;
		}
	}
}

Processing User Inputs#

AppWorldLogic.cs

Source code (C#)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Unigine;

namespace UnigineApp
{
	class AppWorldLogic : WorldLogic
	{
		// declare a player pointer
        PlayerPersecutor player;
		
		public AppWorldLogic()
		{
		}

		public override bool Init()
		{
            // update the application constantly
			App.setBackgroundUpdate(1);
			// get a node
            Node node = World.getNodeByName("material_ball");
            // create a new persecutor
            player = new PlayerPersecutor();
            // set the obtainde node as the target one
            player.setTarget(node.getNode());
            // set player's settings
            player.Anchor = new vec3(0, 0, 0.45f);
            player.PhiAngle = -130.0f;
            player.MinDistance = 0.3f;
            player.MaxDistance = 20.0f;
            player.Distance = 5.0f;
            player.Fov = 35.0f;
            // set the player to the Game Camera viewport
            Game.Player = player;

			return true;
		}

		public override bool Update()
		{
            // change the distance between the player and the target node on mouse wheel scrolling
            int scroll_delta = App.getMouseAxis(App.AXIS_Y);
            if (scroll_delta != 0)
            {
                float f_scroll_delta = scroll_delta / 30.0f;
                player.setDistance(player.getDistance() - f_scroll_delta);
            }

            // zoom the camera in or out when the right mouse button is pressed and the mouse is moved backward/forward
            if (App.getMouseButton() == App.BUTTON_RIGHT)
            {
                float mouse_delta = (Gui.get().getMouseDY() + Gui.get().getMouseDX()) / 500.0f;
                player.setDistance(player.getDistance() - mouse_delta);
            }

			return true;
		}

		public override bool Shutdown()
		{
            // clear the player pointer
            player.clearPtr();

			return true;
		}
	}
}

See Also#

A set of UnigineScript API samples located in the <UnigineSDK>/data/samples/systems/ folder:

  • app_00
  • icon_00
  • mouse_00

App Class

Properties

bool ExternalWindowFocused#

A value indicating whether some external window of the application is currently focused. sdl handles messages only from its own window. when the focus is switched to another window created, for example, by the Interface plugin which handles all its events, the main window stops responding. In such a case you can tell the main window that another external window of the application is focused (e.g., Interface plugin's window).
set
Sets a value indicating whether some external window of the application is currently focused. SDL handles messages only from its own window. When the focus is switched to another window created, for example, by the Interface plugin which handles all its events, the main window stops responding. In such a case you can tell the main window that another external window of the application is focused (e.g., Interface plugin's window).
set value - true to tell the application that some of its external windows is focused; otherwise, false.

bool MouseCursorNeedUpdate#

A value indicating that changes were made to the cursor (e.g., it was shown, hidden, changed to system, etc.) and it has to be updated. suppose the cursor was modified, for example, by the Interface plugin. After closing the plugin's window the cursor shall not return to its previous state because SDL doesn't even know about the changes. You can use this flag to signalize, that mouse cursor must be updated.
set
Sets a value indicating that some changes were made to the cursor (e.g., it was shown, hidden, changed to system, etc.) and it has to be updated. Suppose the cursor was modified, for example, by the Interface plugin. After closing the plugin's window the cursor shall not return to its previous state because SDL doesn't even know about the changes. You can use this flag to signalize, that mouse cursor must be updated.
set value - true to signalize that the mouse cursor has to be updated; otherwise, false.

bool MouseCursorSystem#

A value indicating if the os mouse pointer is displayed.
set
Sets a value indicating if the OS mouse pointer should be displayed.
set value - true to display the OS mouse pointer; otherwise, false.

bool MouseCursorHide#

A value indicating if the mouse cursor is hidden in the current frame.
set
Sets a value indicating if the mouse cursor should be hidden. Can be used, for example, to hide mouse cursor for a certain element.
Notice
This method hides the cursor only for one frame. So, you should call it each frame if a longer period is required.
set value - true to hide the mouse cursor for a single frame, false - to show it.

bool MouseGrab#

A value indicating if the mouse pointer is bound to the application window.
set
Sets a value indicating if the mouse pointer is bound to the application window.
set value - 1 if the mouse cannot leave the application window; otherwise, 0.

Members


int isActive ( ) #

Returns a value indicating if the current application is active (i.e. in focus). The function will always return 1, if the window background update mode is set to 1.
Notice
The sounds will be automatically disabled, if the application is not active.

Return value

1 if application is active; otherwise, 0.

int IsLegacyMode ( ) #

Returns a value indicating if rendering during the Engine's initialization stage is disabled for the application. Engine's boot screen requires rendering to be performed at the Engine's initialization stage. Certain applications do not support rendering in the init() by design. To ensure stable operation for such apps you can disable render-during-init functionality by setting the legacy mode. Thus, the boot screen won't be displayed for these applications.

Return value

1 if rendering during the Engine's initialization stage is disabled for the application; otherwise, 0.

void SetButtonPressFunc ( int (*func)(int button) ) #

Application event which is called when pressing the button. The engine will stop event processing if the event function returns 1.

Arguments

  • int (*func)(int button) - Event function pointer.

void SetButtonReleaseFunc ( int (*func)(int button) ) #

Application event which is called when releasing the button. The engine will stop event processing if the event function Returns 1.

Arguments

  • int (*func)(int button) - Event function pointer.

void SetClipboard ( string str ) #

Updates the contents of the system clipboard.

Arguments

  • string str - Contents to set.

string GetClipboard ( ) #

Retrieves the contents of the system clipboard.

Return value

Contents of the system clipboard.

IntPtr GetHandle ( ) #

Returns a pointer to the application handle.

Return value

Pointer to the application handle.

int IsDone ( ) #

Returns a value indicating if the application is closed.

Return value

1 if the application is closed; otherwise, 0.

int IsInitialized ( ) #

Returns a value indicating if the application is initialized.

Return value

1 if the application is initialized; otherwise, 0.

int GetFlags ( ) #

Returns the video mode flags set for the application.

Return value

Video mode flags: RESIZABLE, FULLSCREEN, etc.

float GetFps ( ) #

Returns the application FPS counter value.

Return value

Application FPS counter value.

float GetMinFps ( ) #

Returns the minimum FPS counter value for the last 600 frames.

Return value

Minimum FPS counter value for the last 600 frames.

float GetMaxFps ( ) #

Returns the maximum FPS counter value for the last 600 frames.

Return value

Maximum FPS counter value for the last 600 frames.

float GetMeanFps ( ) #

Returns the average FPS counter value for the last 600 frames.

Return value

Average FPS counter value for the last 600 frames.

void SetHeight ( int value ) #

Sets the new height for the application window. The height is specified for the window inside and doesn't include the window borders.
Notice
If the INDEPENDENT_SIZE_WINDOW flag is set, only render resolution will be changed, leaving the window size unaffected.

Arguments

  • int value - Application window height, in pixels.

int GetHeight ( ) #

Returns the current height of the application window. The returned value is the window inside height without borders.

Return value

Current height of the application window, in pixels.

int SetIcon ( Image icon ) #

Sets an icon for the application window. The image must be of the square size and RGBA8 format.

Arguments

  • Image icon - Image to be set as application's icon.

Return value

1 if the icon is set successfully; otherwise, 0.

float GetIFps ( ) #

Returns an inverse value of the application FPS counter.

Return value

Inverse value of the application FPS counter (1/FPS).

string GetKeyName ( int key ) #

Returns a name of the given key.
Source code (C#)
Log.Message("getKeyName() returned: {0}\n", App.getKeyName(App.KEY_ALT));
Log.Message("getKeyName() returned: {0}\n", App.getKeyName(97));
Output
getKeyName() returned: ALT
getKeyName() returned: a

Arguments

  • int key - Key in one of the following formats:
    • Character format (for example, 'a')
    • Standard ASCII key code (for example, 97)
    • One of KEY_* variables

Return value

Key name.

void SetKeyPressFunc ( int (*func)(unsigned int key) ) #

Application event which is called on pressing the key. The engine will stop event processing if the event function returns 1.

Arguments

  • int (*func)(unsigned int key) - Event function pointer.

void SetKeyPressUnicodeFunc ( int (*func)(unsigned int key) ) #

Application event which is called on pressing the unicode key. The engine will stop event processing if the event function returns 1.

Arguments

  • int (*func)(unsigned int key) - Event function pointer.

void SetKeyReleaseFunc ( int (*func)(unsigned int key) ) #

Application event which is called on releasing the key. The engine will stop event processing if the event function returns 1.

Arguments

  • int (*func)(unsigned int key) - Event function pointer.

void SetKeyState ( int key, int state ) #

Sets the keyboard key state (pressed or not pressed).
Source code (C#)
// set the ALT button pressed
App.setKeyState(App.KEY_ALT, 1);
// set the 'a' button pressed
App.setKeyState(97, 1);

Arguments

  • int key - Key ID. Possible values can be in range [0;255], which are standard ASCII code symbols, or in range [KEY_ESC;KEY_F12], which are used for control buttons. For full list of control buttons see KEY_* variables.
  • int state - Key state: 1 to set the button pressed; 0 to set the button not pressed.

int GetKeyState ( int key ) #

Returns the keyboard key state (pressed or not pressed).
Source code (C#)
if (App.getKeyState(App.KEY_ALT) == 1) Log.Message("ALT has been pressed\n");
if (App.getKeyState(97) == 1) Log.Message("'a' has been pressed\n");

Arguments

  • int key - Key ID. Possible values can be in range [0;255], which are standard ASCII code symbols, or in range [KEY_ESC;KEY_F12], which are used for control buttons. For full list of control button see KEY_* variables.

Return value

1 if the key is pressed; otherwise, 0.

void SetMouse ( int x, int y ) #

Sets a mouse pointer to the specified position in the coordinate system of the application window.
Source code (C#)
// set a position of the mouse pointer
int mouse_x = App.getWidth() / 2;
int mouse_y = App.getHeight() / 2;

// set the mouse pointer to the position on pressing Esc
if (App.clearKeyState(App.KEY_ESC) == 1)
{
	// check if the mouse pointer is bound to the application window
	if (App.IsMouseGrab == 1)
		// set the pointer to the position
		App.setMouse(mouse_x, mouse_y);
}

Arguments

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

void SetMouseAxis ( int axis, int value ) #

Sets the mouse wheel delta along the specified axis. The delta value is changed when scrolling the mouse wheel horizontally (APP_AXIS_X) or vertically (APP_AXIS_Y).

Arguments

  • int axis - Mouse axis. Possible values are AXIS_X, AXIS_Y.
  • int value - Mouse wheel delta.

int GetMouseAxis ( int axis ) #

Returns the current mouse wheel delta along the specified axis. The delta value is changed when scrolling the mouse wheel horizontally (AXIS_X) or vertically (AXIS_Y).
Source code (C#)
int axis_x = App.getMouseAxis(App.AXIS_X);
int axis_y = App.getMouseAxis(App.AXIS_Y);
if(axis_x > 0) Log.Message("Mouse wheel has been scrolled right\n");
if(axis_x < 0) Log.Message("Mouse wheel has been scrolled left\n");
if(axis_y > 0) Log.Message("Mouse wheel has been scrolled up\n");
if(axis_y < 0) Log.Message("Mouse wheel has been scrolled down\n");

Arguments

Return value

Mouse wheel delta regarding the last wheel position.

void SetMouseButton ( int button ) #

Simulates pressing of the specified mouse buttons.
Source code (C#)
// set the right and middle mouse buttons pressed in addition to already pressed buttons
App.setMouseButton(App.getMouseButton() | App.BUTTON_RIGHT | App.BUTTON_MIDDLE);

Arguments

  • int button - Mouse buttons to be pressed. Possible values are BUTTON_*.

int GetMouseButton ( ) #

Returns the current states of all mouse buttons. Each bit of the returned bit mask will specify the state of the buttons in the following order:
  1. BUTTON_LEFT = 1 << 0
  2. BUTTON_MIDDLE
  3. BUTTON_RIGHT
  4. BUTTON_DCLICK
  5. BUTTON_AUX_0
  6. BUTTON_AUX_1
  7. BUTTON_AUX_2
  8. BUTTON_AUX_3

Return value

A bit mask that stores current states of all mouse buttons (pressed or not pressed).

string GetMouseButtonName ( int button ) #

Returns a name of the given button.

Arguments

Return value

Button name.

int GetMouseButtonState ( int button ) #

Returns a state of the specified button.
Source code (C#)
if (App.getMouseButtonState(App.BUTTON_LEFT | App.BUTTON_DCLICK) == 1) Log.Message("Left mouse button has been clicked\n");
if (App.getMouseButtonState(App.BUTTON_MIDDLE) == 1) Log.Message("Middle mouse button has been clicked\n");

Arguments

Return value

1 if al least one of the specified buttons is pressed; otherwise, 0.

void SetMouseGrab ( int grab ) #

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

Arguments

  • int grab - 1 if the mouse cannot leave the application window; otherwise, 0.

bool IsMouseGrab ( ) #

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

Return value

true if the mouse pointer cannot leave the application window; otherwise, false.

int GetMouseX ( ) #

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 ( ) #

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.

string GetName ( ) #

Returns a name of the graphics API used for application rendering.

Return value

One of the following values:
  • opengl for OpenGL
  • direct3d11 for DirectX 11
  • NULL if no graphics API is used for application rendering

int GetNumTouches ( ) #

Returns the number of touches. The maximum number of touches is 16.

Return value

Number of touches.

int SetPosition ( int x, int y ) #

Sets the window position.

Arguments

  • int x - X coordinate of the upper-left corner of the window.
  • int y - Y coordinate of the upper-left corner of the window.

Return value

1 if the position of the window is set successfully; otherwise, 0.

int GetPositionX ( ) #

Returns the X coordinate of the upper-left corner of the window.

Return value

X coordinate of the upper-left corner of the window.

int GetPositionY ( ) #

Returns the Y coordinate of the upper-left corner of the window.

Return value

Y coordinate of the upper-left corner of the window.

int SetTitle ( string title ) #

Sets a title for the application window.

Arguments

  • string title

Return value

1 if the title is set successfully; otherwise, 0.

int GetTouchX ( int touch ) #

Returns the X coordinate of the touch in the coordinate system of the application window.

Arguments

  • int touch - The touch number.

Return value

X coordinate of the touch.

int GetTouchY ( int touch ) #

Returns the Y coordinate of the touch in the coordinate system of the application window.

Arguments

  • int touch - The toucn number.

Return value

Y coordinate of the touch.

void SetBackgroundUpdate ( bool update ) #

Sets the value indicating whether the application window is updated when the window is hidden or out of focus (rendering frames in background). By default your UNIGINE application stops rendering frames and updating its main window, when it window goes out of focus (e.g. user switches to another window). Setting the background update mode enables constant rendering regardless of whether the application window is focused or in the background.

Arguments

  • bool update - Window update mode: true for constantly repeating update cycle (i.e. the application is updated even if the window is hidden or out of focus); otherwise, false.

bool IsBackgroundUpdate ( ) #

Returns a value indicating whether the application window is updated when the window is hidden or out of focus.

Return value

true if the update cycle is constantly repeated (i.e. the application is updated even if the window is hidden or out of focus); otherwise, false.

int GetVideoAdapter ( ) #

Returns the number of the current video adapter.

Return value

Number of the current video adapter.

bool SetVideoMode ( int width, int height, int flags = 0 ) #

Sets a video mode and initializes the application.

Arguments

Return value

true if the video mode is set and the application is initialized successfully; otherwise, false.

string GetVideoModeName ( ) #

Returns the name of the current video mode.

Return value

Returns the name of the current video mode.

void SetWidth ( int value ) #

Sets the new width of the application window. The width is specified for the window inside part and doesn't include the window borders.
Notice
If the INDEPENDENT_SIZE_WINDOW flag is set, only render resolution will be changed, leaving the window size unaffected.

Arguments

  • int value - Window width, in pixels.

int GetWidth ( ) #

Returns the current application window width. The returned value is the window inside part width without borders.

Return value

Window width, in pixels.

void ButtonPress ( int button ) #

Application notifies the engine that the specified mouse button is pressed.

Arguments

  • int button - One of the BUTTON_* variables.

void ButtonRelease ( int button ) #

Application notifies the engine that the specified mouse button is released.

Arguments

  • int button - One of the BUTTON_* variables.

int ClearKeyState ( int key ) #

Returns the key state and clears it to 0 (not pressed). This function allows returning the key state only once even if it is kept pressed over several frames.

Arguments

  • int key - Key ID. Possible values can be in range [0;255], which are standard ASCII code symbols, or in range [KEY_ESC;KEY_F12], which are used for control buttons. For full list of control buttons see KEY_* variables.

Return value

1 if the key is pressed, and this function was not called previously in the current frame; otherwise, 0.

int ClearMouseAxis ( int axis ) #

Returns the current mouse wheel position delta and clears it to 0.

Arguments

  • int axis - Mouse wheel axis. Possible values are AXIS_X, AXIS_Y.

Return value

Mouse wheel delta regarding the last mouse wheel position.

int ClearMouseButtonState ( int button ) #

Returns the button state and clears it to 0 (not pressed). This function allows returning the button state only once even if it is kept pressed over several frames. The function will return 1 if at least one of the specified buttons is pressed.
Source code (C#)
// the function will return 1 if one of the buttons is pressed;
// the button state will be set to 0
App.clearMouseButtonState(App.BUTTON_LEFT | App.BUTTON_RIGHT);

Arguments

  • int button - Button. Possible values are BUTTON_*.

Return value

1 if at least one of the buttons is pressed, and this function was not called previously in the current frame; otherwise, 0.

int DialogFile ( string title, char[] name, int size, string filter = 0, string flags = 0 ) #

Creates a system modal file dialog. Since the dialog is modal, all other actions are stopped until this function returns a value.

Arguments

  • string title - Title of the dialog window.
  • char[] name - Current file name.
  • int size - Size of the name buffer.
  • string filter - File extension filter. Accepts dot-separated file extensions, for example: ".tga.jpg.png.tif.psd".
  • string flags - File dialog flags. Accepts a string: "o" - open file dialog; "s" - save file dialog; "d" - directory dialog.

Return value

1 if the OK button is pressed; 0 if the Cancel button is pressed.

int DialogMessage ( string title, string str, string flags = 0 ) #

Creates a system modal message dialog. Since the dialog is modal, all other actions are stopped until this function returns a value.
Notice
If you don't specify flags, the Oc combination will be used by default.

Arguments

  • string title - Title of the dialog window.
  • string str - Content of the dialog window.
  • string flags - Dialog window flags. The argument accepts a string with names of buttons. The following combinations are available:
    • Oc or oC - OK, Cancel.
    • Yn or yN - Yes, No
    • ynC, yNc or Ync - Yes, No, Cancel
    Notice
    The uppercase letter indicates which button will be in focus.
    If you send any other combination, only the OK button will appear in the window.

Return value

The function returns one of the following values:
  • 1 if the OK button has been pressed.
  • 2 if the Yes button has been pressed.
  • -1 if the No button has been pressed.
  • 0 if the Cancel button has been pressed.

void Exit ( ) #

The engine requests to exit the application.

void KeyPress ( uint key ) #

Application notifies the engine that the specified key on a keyboard is pressed.

Arguments

  • uint key - Key ID. Possible values can be in range [0;255], which are standard ASCII code symbols, or in range [KEY_ESC;KEY_F12], which are used for control buttons. For full list of control buttons see KEY_* variables.

void KeyPressUnicode ( uint key ) #

Application notifies the engine that the specified key is pressed.

Arguments

  • uint key - Unicode symbol.

void KeyRelease ( uint key ) #

Application notifies the engine that the specified key on a keyboard is released.

Arguments

  • uint key - Key ID. Possible values can be in range [0;255], which are standard ASCII code symbols, or in range [KEY_ESC;KEY_F12], which are used for control buttons. For full list of control buttons see KEY_* variables.

int RestoreVideoMode ( ) #

Restores the video mode of the operating system.

Return value

1 if the video mode is restored successfully; otherwise, 0.

void StartFps ( ) #

Starts the FPS counter if it was stopped. All function calls are placed into a stack, so the number of calls to this function should correspond to the number of calls to the stopFps() function.

void StopFps ( ) #

Stops the FPS counter. This function should be called if application window is hidden or some heavy non-rendering tasks are processing. All function calls are placed into a stack, so the number of calls to this function should correspond to the number of calls to the startFps() function.

void UpdateFps ( ) #

Updates all FPS statistics.

void SetMouseCursorHide ( bool hide ) #

Sets a value indicating if the mouse cursor should be hidden. Can be used, for example, to hide mouse cursor for a certain element.
Notice
This method hides the cursor only for one frame. So, you should call it each frame if a longer period is required.

Arguments

  • bool hide - true to hide the mouse cursor for a single frame, false - to show it.

bool IsMouseCursorHide ( ) #

Returns a value indicating if the mouse cursor is hidden in the current frame.

Return value

true if mouse cursor is hidden in the current frame, false - to show it.

void SetMouseCursorSystem ( bool system ) #

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

Arguments

  • bool system - true to display the OS mouse pointer; otherwise, false.

bool IsMouseCursorSystem ( ) #

Returns a value indicating if the OS mouse pointer is displayed.

Return value

true if the OS mouse pointer is displayed; otherwise, false.

void SetMouseCursorNeedUpdate ( bool update ) #

Sets a value indicating that some changes were made to the cursor (e.g., it was shown, hidden, changed to system, etc.) and it has to be updated. Suppose the cursor was modified, for example, by the Interface plugin. After closing the plugin's window the cursor shall not return to its previous state because SDL doesn't even know about the changes. You can use this flag to signalize, that mouse cursor must be updated.

Arguments

  • bool update - true to signalize that the mouse cursor has to be updated; otherwise, false.

bool IsMouseCursorNeedUpdate ( ) #

Returns a value indicating that changes were made to the cursor (e.g., it was shown, hidden, changed to system, etc.) and it has to be updated. Suppose the cursor was modified, for example, by the Interface plugin. After closing the plugin's window the cursor shall not return to its previous state because SDL doesn't even know about the changes. You can use this flag to signalize, that mouse cursor must be updated.

Return value

true if the mouse cursor has to be updated; otherwise, false.

void SetMouseCursorSkinCustom ( Image image ) #

Sets a custom image to be used for the mouse cursor.

Arguments

  • Image image - Image containing pointer shapes to be set for the mouse cursor (e.g., select, move, resize, etc.).

void SetMouseCursorSkinSystem ( ) #

Sets the current OS cursor skin (pointer shapes like select, move, resize, etc.).

void SetMouseCursorSkinDefault ( ) #

Sets the default Engine cursor skin (pointer shapes like select, move, resize, etc.).

void SetMouseCursorCustom ( Image image, int x = 0, int y = 0 ) #

Sets a custom image for the OS mouse cursor. The image must be of the square size and RGBA8 format.

Arguments

  • Image image - Cursor image to be set.
  • int x - X coordinate of the cursor's hot spot.
  • int y - Y coordinate of the cursor's hot spot.

void ClearMouseCursorCustom ( ) #

Clears the custom mouse cursor set via the setMouseCursorCustom() method.

void UpdateMouseCursor ( ) #

Updates the mouse cursor. This method should be called after making changes to the mouse cursor to apply them all together. After calling this method the cursor shall be updated in the next frame.

bool DialogMessage ( string title, string message ) #

Displays a message dialog with the specified title and text.

Arguments

  • string title - Title of the message dialog to be displayed.
  • string message - Message text to be displayed.

Return value

true if the message is displayed successfully; otherwise, false.

bool DialogWarning ( string title, string warning ) #

Displays a warning dialog with the specified title and text.

Arguments

  • string title - Title of the warning dialog to be displayed.
  • string warning - Warning message text to be displayed.

Return value

true if the message is displayed successfully; otherwise, false.

bool DialogError ( string title, string error ) #

Displays an error dialog with the specified title and text.

Arguments

  • string title - Title of the error dialog to be displayed.
  • string error - Error message text to be displayed.

Return value

true if the message is displayed successfully; otherwise, false.

int ShowSystemDialog ( SystemDialog dialog ) #

Displays a custom system dialog with an arbitrary set of buttons.

Arguments

Return value

number of the dialog button clicked by the user; or -1 if an error has occurred.

string DialogOpenFolder ( string path ) #

Opens a common dialog enabling the user to specify a folder to open. When the dialog opens the specified default path shall be set displaying the corresponding elements.

Arguments

  • string path - Path to be set by default when the dialog opens.

Return value

Resulting folder name specified by the user.

string DialogOpenFolder ( ) #

Opens a common dialog enabling the user to specify a folder to open.

Return value

Resulting folder name specified by the user.

string[] DialogOpenFiles ( string path, string filter ) #

Opens a common dialog enabling the user to specify a list of filenames to open multiple files. When the dialog opens the specified default path and file filter shall be set displaying the corresponding elements.

Arguments

  • string path - Path to be set by default when the dialog opens.
  • string filter - File name filter string to be set by default when the dialog opens. This filter string determines file type choices to be displayed in the Files of type box.

Return value

Resulting list of filenames specified by the user.

string[] DialogOpenFiles ( string path ) #

Opens a common dialog enabling the user to specify a list of filenames to open multiple files. When the dialog opens the specified default path shall be set displaying the corresponding elements.

Arguments

  • string path - Path to be set by default when the dialog opens.

Return value

Resulting list of filenames specified by the user.

string[] DialogOpenFiles ( ) #

Opens a common dialog enabling the user to specify a list of filenames to open multiple files.

Return value

Resulting list of filenames specified by the user.

string DialogOpenFile ( string path, string filter ) #

Opens a common dialog enabling the user to specify a filename to open a file. When the dialog opens the specified default path and file filter shall be set displaying the corresponding elements.

Arguments

  • string path - Path to be set by default when the dialog opens.
  • string filter - File name filter string to be set by default when the dialog opens. This filter string determines file type choices to be displayed in the Files of type box.

Return value

Resulting filename specified by the user.

string DialogOpenFile ( string path ) #

Opens a common dialog enabling the user to specify a filename to open a file. When the dialog opens the specified default path shall be set displaying the corresponding elements.

Arguments

  • string path - Path to be set by default when the dialog opens.

Return value

Resulting filename specified by the user.

string DialogOpenFile ( ) #

Opens a common dialog enabling the user to specify a filename to open a file.

Return value

Resulting filename specified by the user.

string DialogSaveFile ( string path, string filter ) #

Opens a common dialog enabling the user to specify a filename to save a file as. When the dialog opens the specified default path and file filter shall be set displaying the corresponding elements.

Arguments

  • string path - Path to be set by default when the dialog opens.
  • string filter - File name filter string to be set by default when the dialog opens. This filter string determines file type choices to be displayed in the Save as file type or Files of type box.

Return value

Resulting filename specified by the user.

string DialogSaveFile ( string path ) #

Opens a common dialog enabling the user to specify a filename to save a file as. When the dialog opens the specified default path shall be set displaying the corresponding elements.

Arguments

  • string path - Path to be set by default when the dialog opens.

Return value

Resulting filename specified by the user.

string DialogSaveFile ( ) #

Opens a common dialog enabling the user to specify a filename to save a file as.

Return value

Resulting filename specified by the user.

void SetExternalWindowFocused ( bool focused ) #

Sets a value indicating whether some external window of the application is currently focused. SDL handles messages only from its own window. When the focus is switched to another window created, for example, by the Interface plugin which handles all its events, the main window stops responding. In such a case you can tell the main window that another external window of the application is focused (e.g., Interface plugin's window).

Arguments

  • bool focused - true to tell the application that some of its external windows is focused; otherwise, false.

bool IsExternalWindowFocused ( ) #

Returns a value indicating whether some external window of the application is currently focused. SDL handles messages only from its own window. When the focus is switched to another window created, for example, by the Interface plugin which handles all its events, the main window stops responding. In such a case you can tell the main window that another external window of the application is focused (e.g., Interface plugin's window).

Return value

true if some external window of the application is focused; otherwise, false.
Last update: 2021-08-24
Build: ()