This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
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
Учебные материалы

Unigine::Widgets

Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.

Unigine::Widgets are user classes that allow to code user interface only once and use them for both internal GUI (in-app) and external one (rendered in separate windows):

  • If the Unigine-based application is run without the Interface plugin, widgets will be created inside the window, in the same way as default GUI is usually rendered.
  • If the Interface plugin is loaded on the application start-up (via extern_plugin console command), widgets will be automatically created in separate windows in addition to the main application window.

Available Widgets#

Unigine::Widgets act identical to UnigineScript widgets and support completely the same interface:

Also, there are three additional widgets available:

  • Unigine::Widgets::DockBox — a widget that can be dragged and docked inside a window.
  • Unigine::Widgets::Graph — a widget to create flow graphs.
  • Unigine::Widgets::MdiBox — a widget to create multiple windows inside other windows

How to Use Unigine::Widgets Widgets#

  1. Include the necessary headers for widgets you are going to create in your script:
    Source code (UnigineScript)
    #include <core/systems/widgets/widget.h>
    #include <core/systems/widgets/widget_window.h>
  2. Create a widget:
    Source code (UnigineScript)
    int init() {
    	
    	// You can declare the namespace for convenience
    	using Unigine::Widgets;
    	
    	// Create Unigine::Widgets::Window
    	Window window = new Window("Unigine::Widgets::Window");
    	
    	// Add the widget to the rendered GUI
    	addChild(window,ALIGN_OVERLAP | ALIGN_CENTER);
    	
    	return 1;
    }
    When the application is run, either internal WidgetWindow or external InterfaceWidgetWindow will be automatically created depending on whether the Interface plugin is used or not.
Last update: 03.07.2017
Build: ()