Widgets
Samples in this section illustrate the use of the GUI-Related classes.
UserInterface#
Creating a user interface and assigning callbacks via C++ API.
WidgetCallbacks#
Working with widget callbacks via C++ API.
WidgetCanvas#
Creating a widget canvas via C++ API by using the WidgetCanvas class.
WidgetDialog#
Creating widget dialog windows and assigning callbacks via C++ API.
WidgetExtern#
Creating a custom widget based on WidgetExternBase via C++ API and exporting it to UngineScript.
WidgetLifetime#
The sample demonstrates managing the widget lifetime in three ways: while the world is loaded (LIFETIME_WORLD), while the window containing the widgets is open (LIFETIME_WINDOW), and while the engine is running (LIFETIME_ENGINE).
The main window named World Lifetime Widgets contains widgets with LIFETIME_WORLD — these widgets are deleted as the world is closed or reloaded. The console will display the corresponding callback messages (world hbox hierarchy removed, world user interface group removed, world button removed).
The widgets in the Window Lifetime Widgets window are deleted as soon as this window is closed. This action is also followed by the corresponding console messages.
The widgets in the Engine Lifetime Widgets window are only deleted on the engine shutdown. The corresponding callback messages can be seen in the log.txt file.
Manual managing (LIFETIME_MANUAL) of the widget lifetime is not illustrated in this sample.
WidgetWindow#
Creating a widget window and assigning callbacks on edit line and button press events.