|
QuasarEngine
Cross-platform 3D engine and editor
|
The look of the ImGui interface. More...
Functions | |
| void | ApplyStyle (ImGuiStyle &style, float dpiScale) |
| Replaces the colors, spacing and rounding of a style with the engine theme. | |
| std::filesystem::path | GetFontPath () |
| Returns where the engine font is expected: resources/fonts/Inter/Inter-Regular.ttf, in the folder of the executable. | |
| bool | LoadFont (ImFontAtlas &atlas, const std::filesystem::path &file) |
| Loads a font file as the default font of an atlas, at FontSize. | |
Variables | |
| constexpr float | FontSize = 16.0f |
| Height of the text in pixels on a standard screen, before the DPI scale. | |
The look of the ImGui interface.
The colors, spacing and font size are defined in ImGuiTheme.cpp, so they can be changed in one place.
| void Quasar::ImGuiTheme::ApplyStyle | ( | ImGuiStyle & | style, |
| float | dpiScale ) |
Replaces the colors, spacing and rounding of a style with the engine theme.
The spacing and the text are multiplied by the DPI scale, so they keep the same physical size on high-DPI screens.
| style | The style to change, usually ImGui::GetStyle(). Every value is replaced. |
| dpiScale | The content scale of the monitor: 1 on a standard screen, 2 on a screen with twice the pixel density. Values of 0 or less are read as 1. |
| std::filesystem::path Quasar::ImGuiTheme::GetFontPath | ( | ) |
Returns where the engine font is expected: resources/fonts/Inter/Inter-Regular.ttf, in the folder of the executable.
The build copies the engine resources there.
| bool Quasar::ImGuiTheme::LoadFont | ( | ImFontAtlas & | atlas, |
| const std::filesystem::path & | file ) |
Loads a font file as the default font of an atlas, at FontSize.
When the file is missing or is not a font, the scalable font embedded in ImGui is used instead, and the reason is logged as an engine warning.
| atlas | The atlas that receives the font, usually ImGui::GetIO().Fonts. It must not have any font yet. |
| file | The TrueType or OpenType file to load. |