This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm (Experimental)
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
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
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine.UserInterface Class

The class is used to work with widgets that are created by loading a UI file.

See Also#

  • C++ API sample <UnigineSDK>/source/samples/Api/Widgets/UserInterface
  • C# API sample <UnigineSDK>/source/csharp/samples/Api/Widgets/UserInterface

UserInterface Class

Properties

int NumWidgets#

The number of associated widgets.

Members


static UserInterface ( Gui gui, string name, string prefix = 0 ) #

UserInterface constructor.

Arguments

  • Gui gui - GUI smart pointer.
  • string name - User interface name.
  • string prefix - Names prefix.

int GetCallback ( int num, int callback ) #

Returns the number of a given callback function.

Arguments

  • int num - Widget number.
  • int callback

Return value

Callback number.

IntPtr addCallback ( string name, Gui.CALLBACK_INDEX callback, Callback0Delegate func ) #

Adds a callback function of the specified type for the widget with the specified name.The signature of the callback function must be as follows:
Source code (C#)
void callback_function_name();

Arguments

  • string name - Widget name.
  • Gui.CALLBACK_INDEX callback
  • Callback0Delegate func - Callback function with the following signature: void Callback0Delegate()

Return value

ID of the last added callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.

IntPtr addCallback ( string name, Gui.CALLBACK_INDEX callback, Callback1Delegate func ) #

Adds a callback function of the specified type for the widget with the specified name.The signature of the callback function must be as follows:
Source code (C#)
void callback_function_name(Widget widget);

Arguments

  • string name - Widget name.
  • Gui.CALLBACK_INDEX callback
  • Callback1Delegate func - Callback function with the following signature: void Callback1Delegate(Widget widget)

Return value

ID of the last added callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.

IntPtr addCallback ( string name, Gui.CALLBACK_INDEX callback, Call2backDelegate func ) #

Adds a callback function of the specified type for the widget with the specified name.The signature of the callback function must be as follows:
Source code (C#)
void callback_function_name(Widget widget1, Widget widget2);

Arguments

  • string name - Widget name.
  • Gui.CALLBACK_INDEX callback
  • Call2backDelegate func - Callback function with the following signature: void Callback2Delegate(Widget widget1, Widget widget2)

Return value

ID of the last added callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.

IntPtr addCallback ( string name, Gui.CALLBACK_INDEX callback, Callback3Delegate func ) #

Adds a callback function of the specified type for the widget with the specified name.The signature of the callback function must be as follows:
Source code (C#)
void callback_function_name(Widget widget1, Widget widget2, int arg3);

Arguments

  • string name - Widget name.
  • Gui.CALLBACK_INDEX callback
  • Callback3Delegate func - Callback function with the following signature: void Callback3Delegate(Widget widget1, Widget widget2, int arg3)

Return value

ID of the last added callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.

bool removeCallback ( string name, Gui.CALLBACK_INDEX callback, IntPtr id ) #

Removes the specified callback from the list of callbacks of the specified type added for the widget with the given name.

Arguments

Return value

True if the callback with the given ID was removed successfully; otherwise false.

void clearCallbacks ( string name, Gui.CALLBACK_INDEX callback ) #

Clears all callbacks of the specified type added for the widget with the given name.

Arguments

string GetCallbackInstanceData ( int num, Gui.CALLBACK_INDEX callback ) #

Returns the callback instance data.

Arguments

Return value

Callback instance data.

string GetCallbackName ( int num, Gui.CALLBACK_INDEX callback ) #

Returns the name of a given callback function.

Arguments

Return value

Callback function name.

string GetCallbackStringData ( int num, Gui.CALLBACK_INDEX callback ) #

Returns the callback string data.

Arguments

Return value

Callback string data.

string GetCallbackVariableData ( int num, Gui.CALLBACK_INDEX callback ) #

Returns the callback variable data.

Arguments

Return value

Callback variable data.

Widget GetCallbackWidgetData ( int num, Gui.CALLBACK_INDEX callback ) #

Returns the callback widget data.

Arguments

Return value

Widget data.

int GetNumCallbacks ( int num ) #

Returns the total number of callbacks for a given widget.

Arguments

  • int num - Widget number.

Return value

Number of callbacks.

Widget GetWidget ( int num ) #

Returns pointer to the widget with a given number.

Arguments

  • int num - Widget ID.

Return value

Pointer to the widget with the given number.

int GetWidgetExport ( int num ) #

Returns a value indicating if a given widget is exported into a script.

Arguments

  • int num - Widget ID.

Return value

Returns 1 if the widget is exported; otherwise, 0.

string GetWidgetName ( int num ) #

Returns widget name by its number.

Arguments

  • int num - Widget ID.

Return value

Widget name.

string GetWidgetNext ( int num ) #

Returns the name of the widget, which will be focused next.

Arguments

  • int num - Widget number.

Return value

Next Widget name.

int FindWidget ( string name ) #

Searches a widget by its name.

Arguments

  • string name - Widget name.

Return value

Returns the number of the widget if exists; otherwise, -1.

void UpdateWidgets ( ) #

Updates all widgets belonging to the user interface. This function should be called, for example, after change of the interface language.
Last update: 2020-11-24
Build: ()