Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
shkyera::UI Class Reference

A class responsible for managing the user interface (UI) of the application. More...

#include <UI.hpp>

Public Member Functions

 UI ()
 Constructor to create a UI manager for the specified game.
 
void initialize (std::shared_ptr< Registry > registry)
 Initialize the systems and widgets.
 
void draw ()
 Render the UI.
 
void close ()
 Close and clean up the UI.
 
bool shouldClose () const
 Check if the UI should be closed.
 

Private Member Functions

void initializeImgui ()
 Initialize ImGui and other UI elements.
 
void initializeWidgets ()
 Initialize UI widgets.
 
void initializeAssets ()
 Initialize UI assets.
 
void styleImgui ()
 Apply styling to ImGui elements.
 
void beginFrame ()
 Begin a UI frame.
 
void renderFrame ()
 Render the UI frame.
 
void endFrame ()
 End the UI frame.
 

Private Attributes

std::shared_ptr< Registry_registry
 A shared pointer to the associated game.
 
std::vector< std::unique_ptr< Widget > > _widgets
 A collection of UI widgets.
 
bool _open
 Flag indicating if the UI is open.
 
GLFWwindow_window
 The UI window.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ UI()

shkyera::UI::UI ( )

Constructor to create a UI manager for the specified game.

Member Function Documentation

◆ beginFrame()

void shkyera::UI::beginFrame ( )
private

Begin a UI frame.

◆ close()

void shkyera::UI::close ( )

Close and clean up the UI.

◆ draw()

void shkyera::UI::draw ( )

Render the UI.

◆ endFrame()

void shkyera::UI::endFrame ( )
private

End the UI frame.

◆ initialize()

void shkyera::UI::initialize ( std::shared_ptr< Registry registry)

Initialize the systems and widgets.

Parameters
registryA shared pointer to the registry that the UI will configure.

◆ initializeAssets()

void shkyera::UI::initializeAssets ( )
private

Initialize UI assets.

◆ initializeImgui()

void shkyera::UI::initializeImgui ( )
private

Initialize ImGui and other UI elements.

◆ initializeWidgets()

void shkyera::UI::initializeWidgets ( )
private

Initialize UI widgets.

◆ renderFrame()

void shkyera::UI::renderFrame ( )
private

Render the UI frame.

◆ shouldClose()

bool shkyera::UI::shouldClose ( ) const

Check if the UI should be closed.

Returns
True if the UI should be closed, false otherwise.

◆ styleImgui()

void shkyera::UI::styleImgui ( )
private

Apply styling to ImGui elements.

Member Data Documentation

◆ _open

bool shkyera::UI::_open
private

Flag indicating if the UI is open.

◆ _registry

std::shared_ptr<Registry> shkyera::UI::_registry
private

A shared pointer to the associated game.

◆ _widgets

std::vector<std::unique_ptr<Widget> > shkyera::UI::_widgets
private

A collection of UI widgets.

◆ _window

GLFWwindow* shkyera::UI::_window
private

The UI window.


The documentation for this class was generated from the following files: