A base class representing a user interface (UI) for a game object's component.
More...
#include <UIComponent.hpp>
|
| UIComponent (std::string name, std::shared_ptr< GameObject > object) |
| Constructor to create a UI component with a specified name and associated game object. More...
|
|
virtual void | draw ()=0 |
| Abstract method to draw the UI component. More...
|
|
A base class representing a user interface (UI) for a game object's component.
The UIComponent
class defines the common interface for UI object components and provides functionality for managing and rendering them within the app.
◆ UIComponent()
shkyera::UIComponent::UIComponent |
( |
std::string |
name, |
|
|
std::shared_ptr< GameObject > |
object |
|
) |
| |
Constructor to create a UI component with a specified name and associated game object.
- Parameters
-
name | The name of the UI component. |
object | A shared pointer to the game object associated with the UI component. |
◆ addComponentToObject()
void shkyera::UIComponent::addComponentToObject |
( |
std::shared_ptr< GameObject > |
object, |
|
|
std::shared_ptr< UIComponent > |
component |
|
) |
| |
|
static |
Static method to add a UI component to a game object.
- Parameters
-
object | A shared pointer to the game object. |
component | A shared pointer to the UI component to add. |
◆ draw()
virtual void shkyera::UIComponent::draw |
( |
| ) |
|
|
pure virtual |
◆ getComponentsOfObject()
std::vector< std::shared_ptr< UIComponent > > shkyera::UIComponent::getComponentsOfObject |
( |
std::shared_ptr< GameObject > |
object | ) |
|
|
static |
Static method to retrieve a list of UI components associated with a game object.
- Parameters
-
object | A shared pointer to the game object. |
- Returns
- A vector of shared pointers to UI components associated with the game object.
◆ _name
std::string shkyera::UIComponent::_name |
|
protected |
The name of the UI component.
◆ _object
std::shared_ptr<GameObject> shkyera::UIComponent::_object |
|
protected |
The game object associated with the UI component.
◆ _objectComponents
std::unordered_map< std::shared_ptr< GameObject >, std::vector< std::shared_ptr< UIComponent > > > shkyera::UIComponent::_objectComponents = {} |
|
staticprivate |
◆ _uuid
uint64_t shkyera::UIComponent::_uuid |
|
protected |
A unique identifier for the UI component.
The documentation for this class was generated from the following files: