-
-
Notifications
You must be signed in to change notification settings - Fork 5
Creating and learning about UI components
Before we begin with setting up the UI components, we first need to talk about where your source files as a framework programmer go.
There are 3 types of files
- UI Components
- The Instance
- Wrapper functions
Each type is located in a specific directory as follows:
- Instance and UI Components:
Source/
- Wrapper Functions:
WrapperSource/
In this guide we're primarily focusing on the UI Components, with our goal being to write a "Hello, World" example.
All the above-mentioned files follow strict file templates that can be automatically generated by using the UVKBuildTool. To generate the files navigate to UVKBuildTool/build and run the UVKBuildTool executable like this
./UVKBuildTool --help
or for Windows
./UVKBuildTool.exe --help
The result of the command should be like this:
UVKBuildTool - The universal UntitledVulkanGameEngine and UntitledImGuiFramework file generator
Arguments:
--generate <project path> - Regenerates all required generated files for the given project
--install <project path> - Generates the project files when installing for the first time
--build <project path> - Bundles the application and compiles it for production
--help - This help message
The following arguments generate source files for UI components:
--inline <name> <project path> - Creates an inline component
--window <name> <project path> - Creates a window widget
--title-bar <name> <project path> - Creates a titlebar widget
UVKBuild tool, made by MadLad Squad, developed and maintained by Stanislav Vasilev(Madman10K)
As you can see from the output there are 3 possible types of UI Components:
- Inline
- Window
- TitleBar
Additionally, another scriptable class is the Instance
, which defines which components are active as well as other
information about the application that the framework can use
Components work in the following way:
Every component is a subclass of their respective interface, this class overrides the default pure virtual functions a.k.a. its events. Any code called in the events of a component gets called at some point in the application's render loop. All components have the following events
- Constructor
- begin
- tick
- end
- Destructor
The constructor and destructor are self-explanatory, the begin
function gets called after the UI is initialised,
just before the start of the application's render loop. It is important to mention here, that the event part of the
Instance
called onEventConfigureStyle
gets called before the "begin" event.
The tick
function is called in the render loop at this specific order
-
tick
of the title bar components -
tick
of the inline components -
tick
of the window components
Why is it like this? Well the title bar components are actually inline components that get rendered at the top, the only reason they are not actual inline components is that they have some special functionality such as providing window movement, decorations and more.
The end
is called after the render loop is closed before destroying any resources including the UI and Window.
After that the layout inside the config directory gets saved and the application shuts down
Documentation and reference on all types of UI components and the Instance can be found here, if you ARE a new developer to the framework READ the following pages before continuing with the roadmap:
This project is supported by all the people who joined our discord server and became beta testers. If you want to join the discord you can click here.
- Home
- Beginner content
- Install guide
- Creating and using the UI components
- The Instance
- The Init Info struct
- Textures
- Logging
- Unicode support
- Additional features
- Client-side bar
- Custom type definitions
- Memory management
- C API development
- Config files and Folders
- Interfaces
- Internal Event safety
- Customising the build system
- Modules system
- Collaborating with others
- Advanced content
- Developer and contributor resources
- Misc