Shkyera Engine
Easy to use, game engine for Python
shkyera::ShapeUIComponent Class Referenceabstract

A specialized UIComponent for rendering shapes within a graphical user interface. More...

#include <ShapeUIComponent.hpp>

Inheritance diagram for shkyera::ShapeUIComponent:
[legend]

Public Member Functions

virtual ~ShapeUIComponent ()=default
 Virtual destructor for ShapeUIComponent. More...
 
virtual void draw () override
 Draw the shape within the UI component. More...
 
virtual void drawOptions ()=0
 Draw options specific to the shape. More...
 
virtual void initialize (std::shared_ptr< Renderer > renderer)=0
 Initialize the ShapeUIComponent. More...
 
 UIComponent (std::string name, std::shared_ptr< GameObject > object)
 Constructor for ShapeUIComponent. More...
 
- Public Member Functions inherited from 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. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from shkyera::UIComponent
static void addComponentToObject (std::shared_ptr< GameObject > object, std::shared_ptr< UIComponent > component)
 Static method to add a UI component to a game object. More...
 
static std::vector< std::shared_ptr< UIComponent > > getComponentsOfObject (std::shared_ptr< GameObject > object)
 Static method to retrieve a list of UI components associated with a game object. More...
 
- Protected Attributes inherited from shkyera::UIComponent
uint64_t _uuid
 A unique identifier for the UI component. More...
 
std::string _name
 The name of the UI component. More...
 
std::shared_ptr< GameObject_object
 The game object associated with the UI component. More...
 

Detailed Description

A specialized UIComponent for rendering shapes within a graphical user interface.

The ShapeUIComponent class extends the basic UIComponent class and provides methods for drawing shapes and handling their options. This class should be further subclassed to implement specific shapes and their drawing logic.

Constructor & Destructor Documentation

◆ ~ShapeUIComponent()

virtual shkyera::ShapeUIComponent::~ShapeUIComponent ( )
virtualdefault

Virtual destructor for ShapeUIComponent.

Member Function Documentation

◆ draw()

void shkyera::ShapeUIComponent::draw ( )
overridevirtual

Draw the shape within the UI component.

This method is responsible for rendering the UI component. Subclasses should implement this method to define the drawing behavior for their specific shape type.

Implements shkyera::UIComponent.

◆ drawOptions()

virtual void shkyera::ShapeUIComponent::drawOptions ( )
pure virtual

Draw options specific to the shape.

This pure virtual method should be implemented by subclasses to draw shape-specific options within the user interface, if applicable.

Implemented in shkyera::ShapeRectangleUIComponent, shkyera::ShapeLineUIComponent, and shkyera::ShapeCircleUIComponent.

◆ initialize()

virtual void shkyera::ShapeUIComponent::initialize ( std::shared_ptr< Renderer renderer)
pure virtual

Initialize the ShapeUIComponent.

Subclasses should implement this method to perform any initialization steps required for their specific shape rendering. In particular, they should assign the renderer.

Parameters
rendererA shared pointer to the Renderer used for rendering.

Implemented in shkyera::ShapeRectangleUIComponent, shkyera::ShapeLineUIComponent, and shkyera::ShapeCircleUIComponent.

◆ UIComponent()

shkyera::UIComponent::UIComponent

Constructor for ShapeUIComponent.


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