Shkyera Engine
Easy to use, game engine for Python
ShapeRectangleComponent.hpp
Go to the documentation of this file.
1 
7 #pragma once
8 
10 #include <glm/glm.hpp>
11 
12 namespace shkyera {
13 
24  public:
28  using ShapeComponent::ShapeComponent;
29 
35  void setWidth(float w);
36 
42  void setHeight(float h);
43 
49  void setColor(glm::vec3 color);
50 
58  virtual void drawShape() override;
59 
60  private:
61  glm::vec3 _color; //< The color of the rectangle.
62  float _width; //< The width of the rectangle.
63  float _height; //< The height of the rectangle.
64 };
65 
66 } // namespace shkyera
Defines the ShapeComponent class, a base component for handling shapes.
A base component for handling shapes within a game or application.
Definition: ShapeComponent.hpp:24
A specialized shape component for rendering rectangles within a game or application.
Definition: ShapeRectangleComponent.hpp:23
void setColor(glm::vec3 color)
Set the color of the rectangle.
Definition: ShapeRectangleComponent.cpp:17
float _width
Definition: ShapeRectangleComponent.hpp:62
float _height
Definition: ShapeRectangleComponent.hpp:63
void setWidth(float w)
Set the width of the rectangle.
Definition: ShapeRectangleComponent.cpp:15
glm::vec3 _color
Definition: ShapeRectangleComponent.hpp:61
virtual void drawShape() override
Draw the rectangle shape.
Definition: ShapeRectangleComponent.cpp:7
void setHeight(float h)
Set the height of the rectangle.
Definition: ShapeRectangleComponent.cpp:16
Definition: Entity.cpp:3