Shkyera Engine
Easy to use, game engine for Python
shkyera::ShapeRectangleComponent Class Referencefinal

A specialized shape component for rendering rectangles within a game or application. More...

#include <ShapeRectangleComponent.hpp>

Inheritance diagram for shkyera::ShapeRectangleComponent:
[legend]

Public Member Functions

void setWidth (float w)
 Set the width of the rectangle. More...
 
void setHeight (float h)
 Set the height of the rectangle. More...
 
void setColor (glm::vec3 color)
 Set the color of the rectangle. More...
 
virtual void drawShape () override
 Draw the rectangle shape. More...
 
- Public Member Functions inherited from shkyera::ShapeComponent
void setRenderer (std::shared_ptr< Renderer > renderer)
 Set the renderer for this shape component. More...
 
 Component (std::shared_ptr< GameObject > object)
 Constructor for ShapeComponent. More...
 
- Public Member Functions inherited from shkyera::Component
 Component (std::shared_ptr< GameObject > object)
 Constructor to initialize a component with a shared pointer to a game object. More...
 
std::shared_ptr< GameObjectgetObject ()
 Get the shared pointer to the game object to which this component is attached. More...
 

Private Attributes

glm::vec3 _color
 
float _width
 
float _height
 

Additional Inherited Members

- Static Public Member Functions inherited from shkyera::ShapeComponent
static void addShape (std::shared_ptr< ShapeComponent > shape)
 Add a shape component to the list of managed shapes. More...
 
static void removeShape (std::shared_ptr< ShapeComponent > shape)
 Remove a shape component from the list of managed shapes. More...
 
static std::vector< std::shared_ptr< ShapeComponent > > getShapes ()
 Get the list of managed shape components. More...
 
- Protected Attributes inherited from shkyera::ShapeComponent
std::shared_ptr< Renderer_renderer
 
- Protected Attributes inherited from shkyera::Component
std::shared_ptr< GameObject_object
 The game object to which this component is attached. More...
 

Detailed Description

A specialized shape component for rendering rectangles within a game or application.

The ShapeRectangleComponent class is designed for rendering rectangle shapes. It extends the ShapeComponent class and provides methods to set the dimensions and color of the rectangle and to draw it.

Member Function Documentation

◆ drawShape()

void shkyera::ShapeRectangleComponent::drawShape ( )
overridevirtual

Draw the rectangle shape.

This method is responsible for rendering the rectangle shape using the provided renderer. Subclasses should implement this method to define the drawing behavior for the specific rectangle shape.

Implements shkyera::ShapeComponent.

◆ setColor()

void shkyera::ShapeRectangleComponent::setColor ( glm::vec3  color)

Set the color of the rectangle.

Parameters
colorA glm::vec3 representing the color of the rectangle.

◆ setHeight()

void shkyera::ShapeRectangleComponent::setHeight ( float  h)

Set the height of the rectangle.

Parameters
hThe height of the rectangle.

◆ setWidth()

void shkyera::ShapeRectangleComponent::setWidth ( float  w)

Set the width of the rectangle.

Parameters
wThe width of the rectangle.

Member Data Documentation

◆ _color

glm::vec3 shkyera::ShapeRectangleComponent::_color
private

◆ _height

float shkyera::ShapeRectangleComponent::_height
private

◆ _width

float shkyera::ShapeRectangleComponent::_width
private

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