-
-
Notifications
You must be signed in to change notification settings - Fork 5
Knobs module
The imgui-knobs library provides knob widgets to dear imgui like these:
To enable the knobs module, update your uvproj.yaml
so that the knobs
key under enabled-modules
is set to true like this:
name: "MyProject"
version: "1.0.0.0"
engine-version: "1.0.0.0"
enabled-modules:
knobs: true
Then, regenerate the modules cache by running the following command:
user $ ./UVKBuildTool --generate <project directory>
After that, refresh your CMake project with cmake ..
!
Next, include the Modules.hpp
header in your components, like this:
#include <Modules/Modules.hpp>
The entire module is flagged as event safe at All ready
In one of your widgets, add the following code to your tick function:
static float value = 0;
if (ImGuiKnobs::Knob("Volume", &value, -6.0f, 6.0f, 0.1f, "%.1fdB", ImGuiKnobVariant_Tick)) {
// value was changed
}
Compile and run.
To learn more about the knobs module, navigate to the imgui-knobs GitHub repository.
To check for the module at compile time, use the UIMGUI_KNOBS_MODULE_ENABLED
macro.
Runtime checking can be done using the knobs
member of the ModuleSettings
struct. More info can be found
here.
We provide a C API for the knobs module as part of the cimgui_extra project. To use it, simply include #include <cimgui_extra/cimgui-knobs.h>
.
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