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

用于用户接口的Unigine::Widgets

警告
UnigineScript的应用范围仅限于实现与材质相关的逻辑(材质表达式,可编写脚本的材质,画笔材质)。 不要将UnigineScript用作应用程序逻辑的语言,请改用C#/C++,因为这些API是首选的。 无法保证UnigineScript中新引擎功能的可用性(超出其应用范围),因为当前的支持级别仅假设已解决关键问题。

可使用 用户接口文件 (*.ui)对工具集的陈列方式进行描述。 可使用Unigine UI 语法手动创建这样的UI文件。使用Unigine::Widgets::UserInterface类对文件进行处理。

How to Load Unigine UI如何加载Unigine UI#

要加载Unigine本地用户接口文件,需按如下步骤进行:

  1. 包含 UserInterface标题。其它所有Unigine::Widgets标题已被包含在内。
    源代码 (UnigineScript)
    #include <core/systems/widgets/widget_interface.h>
  2. 阐明UserInterface且来自UI文件的根工具集具有全局范围。
    源代码 (UnigineScript)
    #include <core/systems/widgets/widget_interface.h>
    
    Unigine::Widgets::UserInterface ui;
    Unigine::Widgets::Window window;
  3. 加载用户接口文件。也需要添加根工具集到渲染的GUI上,这样根工具集才可见。
    源代码 (UnigineScript)
    int init() {
    	
    	// 为了便利,可声明命名空间
    	using Unigine::Widgets;
    	
    	// 使用Unigine语法加载UI文件
    	ui = new UserInterface("samples/systems/widgets/widgets_01.ui");
    	
    	// 渲染根小工具
    	addChild(window,ALIGN_OVERLAP | ALIGN_CENTER);
    	
    	return 1;
    }
    
    int shutdown() {
    	
    	// 使用所有从UserInterface加载的小工具集删除UserInterface
    	delete ui;
    	
    	return 1;
    }
最新更新: 2017-07-03
Build: ()