Shkyera Engine
Easy to use, game engine for Python
|
A class responsible for managing the user interface (UI) of the application. More...
#include <UI.hpp>
Public Member Functions | |
UI (std::shared_ptr< Game > game) | |
Constructor to create a UI manager for the specified game. More... | |
void | initialize () |
Initialize the UI, including ImGui, widgets, and assets. More... | |
void | draw () |
Render the UI. More... | |
void | close () |
Close and clean up the UI. More... | |
bool | shouldClose () const |
Check if the UI should be closed. More... | |
Static Public Attributes | |
static ImFont * | NORMAL_FONT = nullptr |
The normal font used in the UI. More... | |
static ImFont * | BIG_FONT = nullptr |
A larger font used in the UI. More... | |
static ImFont * | HUGE_FONT = nullptr |
An even larger font used in the UI. More... | |
static ImFont * | SMALL_FONT = nullptr |
A smaller font used in the UI. More... | |
static ImVec4 | BACKGROUND_COLOR = ImVec4(0.17f, 0.17f, 0.17f, 1.0f) |
Background color. More... | |
static ImVec4 | TEXT_COLOR = ImVec4(0.86f, 0.86f, 0.86f, 1.0f) |
Text color. More... | |
static ImVec4 | DISABLED_TEXT_COLOR = ImVec4(0.86f, 0.93f, 0.89f, 0.28f) |
Disabled text color. More... | |
static ImVec4 | ACCENT_COLOR = ImVec4(0.4f, 0.05f, 0.7f, 1.0f) |
Accent color. More... | |
static ImVec4 | STRONG_ACCENT_COLOR = ImVec4(0.5f, 0.06f, 0.82f, 1.0f) |
Strong accent color. More... | |
static ImVec4 | GREY = ImVec4(0.3f, 0.3f, 0.3f, 1.0f) |
Grey color. More... | |
static ImVec4 | LIGHT_GREY = ImVec4(0.8f, 0.8f, 0.8f, 1.0f) |
Light grey color. More... | |
static ImVec4 | DARK_ACCENT = ImVec4(0.1f, 0.1f, 0.1f, 1.0f) |
Dark accent color. More... | |
static ImVec4 | BLACK = ImVec4(0.0f, 0.0f, 0.0f, 0.0f) |
Black color. More... | |
Private Member Functions | |
void | initializeImgui () |
Initialize ImGui and other UI elements. More... | |
void | initializeWidgets () |
Initialize UI widgets. More... | |
void | initializeAssets () |
Initialize UI assets. More... | |
void | initializeInterpreter () |
Initialize the Python interpreter. More... | |
void | styleImgui () |
Apply styling to ImGui elements. More... | |
void | beginFrame () |
Begin a UI frame. More... | |
void | renderFrame () |
Render the UI frame. More... | |
void | endFrame () |
End the UI frame. More... | |
Private Attributes | |
std::shared_ptr< Game > | _game |
A shared pointer to the associated game. More... | |
std::shared_ptr< Renderer > | _renderer |
A shared pointer to the renderer. More... | |
bool | _open |
Flag indicating if the UI is open. More... | |
GLFWwindow * | _window |
The UI window. More... | |
std::vector< std::unique_ptr< Widget > > | _widgets |
A collection of UI widgets. More... | |
A class responsible for managing the user interface (UI) of the application.
The UI
class is responsible for initializing and rendering the UI elements, including widgets, using ImGui.
shkyera::UI::UI | ( | std::shared_ptr< Game > | game | ) |
|
private |
Begin a UI frame.
void shkyera::UI::close | ( | ) |
Close and clean up the UI.
void shkyera::UI::draw | ( | ) |
Render the UI.
|
private |
End the UI frame.
void shkyera::UI::initialize | ( | ) |
Initialize the UI, including ImGui, widgets, and assets.
|
private |
Initialize UI assets.
|
private |
Initialize ImGui and other UI elements.
|
private |
Initialize the Python interpreter.
|
private |
Initialize UI widgets.
|
private |
Render the UI frame.
bool shkyera::UI::shouldClose | ( | ) | const |
|
private |
Apply styling to ImGui elements.
|
private |
A shared pointer to the associated game.
|
private |
Flag indicating if the UI is open.
|
private |
A shared pointer to the renderer.
|
private |
The UI window.
|
inlinestatic |
Accent color.
|
inlinestatic |
Background color.
|
static |
A larger font used in the UI.
|
inlinestatic |
Black color.
|
inlinestatic |
Dark accent color.
|
inlinestatic |
Disabled text color.
|
inlinestatic |
Grey color.
|
static |
An even larger font used in the UI.
|
inlinestatic |
Light grey color.
|
static |
The normal font used in the UI.
|
static |
A smaller font used in the UI.
|
inlinestatic |
Strong accent color.
|
inlinestatic |
Text color.