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
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-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
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

GUI

The current article describes the native GUI, which includes the following:

General info#

Unigine provides flexible Graphic User Interface (GUI), its main features are:

  • Various widgets and containers
  • Dialog windows
  • 3D effects
  • Activation animation
  • Easy skin changing
  • UI files in XML format
  • Localization support
  • True Type fonts support
  • Unicode (UTF8) support
  • IME input support

How to Create GUI Layout#

There are 2 ways to create the GUI layout:

By Scripting#

To create widgets directly from a script, perform the following steps:

  1. Declare all of the widgets as global variables in the script.
  2. Create the corresponding object for each widget.
  3. Define necessary properties for each object (height, width, etc.) by using functions of the corresponding GUI-related classes.
  4. Add root widgets to be rendered in the GUI interface via Gui::addChild().
  5. Add children of the root widgets to be rendered in the GUI interface via Gui::addChild().

By Using UI files#

To create widgets and describe the layout by using User interface (UI) files, perform the following:

  1. Create *.ui file that describes what widgets should be drawn and how they are laid out (see more details).
  2. Declare root widgets (or containers) as global variables in the script.
  3. Load User interface by using the UserInterface() constructor.
  4. Add root widgets to be rendered in the GUI interface via Gui::addChild().

This is faster and more convenient way to create a GUI.

How to Create Custom GUI Skin#

  1. Create all required GUI textures (see details on Skin Layout).
  2. If necessary, create Resource file (RC) where global settings for GUI interface are described.
  3. Use custom skin:
    • If you need to change the system GUI skin (2D GUI), replace files under data/core/gui folder.
    • If ObjectGui or ObjectGuiMesh (that is, monitors positioned in the world) is used, specify a folder with all textures, RC file and the default font in the constructor.
Last update: 2024-04-19
Build: ()