Shkyera Engine
Easy to use, game engine for Python
|
A specialized shape component for rendering lines within a game or application. More...
#include <ShapeLineComponent.hpp>
Public Member Functions | |
void | setX (float x) |
Set the X-coordinate of the line's displacement. More... | |
void | setY (float y) |
Set the Y-coordinate of the line's displacement. More... | |
virtual void | drawShape () override |
Draw the line 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< GameObject > | getObject () |
Get the shared pointer to the game object to which this component is attached. More... | |
Private Attributes | |
float | _x |
float | _y |
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... | |
A specialized shape component for rendering lines within a game or application.
The ShapeLineComponent class is designed for rendering lines. It extends the ShapeComponent class and provides methods to set the size of the line and draw it.
|
overridevirtual |
Draw the line shape.
This method is responsible for rendering the line shape using the provided renderer. Subclasses should implement this method to define the drawing behavior for the specific line shape.
Implements shkyera::ShapeComponent.
void shkyera::ShapeLineComponent::setX | ( | float | x | ) |
Set the X-coordinate of the line's displacement.
x | The X-coordinate of the line's displacement. |
void shkyera::ShapeLineComponent::setY | ( | float | y | ) |
Set the Y-coordinate of the line's displacement.
y | The Y-coordinate of the line's displacement. |
|
private |
|
private |