SDL Utility
Shape Class Reference

The non-instantiable base class for all SDLU shapes. More...

#include <Shape.hpp>

Inheritance diagram for Shape:
Drawable Transformable sdlu::Rectangle

Public Member Functions

virtual ~Shape ()
 Deconstructor. More...
 
void SetColor (const Color &color)
 Sets the color of the shape. More...
 
Color GetColor ()
 Gets the color of the shape. More...
 
- Public Member Functions inherited from Drawable
 Drawable (const Drawable &other)=delete
 
 Drawable (Drawable &&other)=delete
 
Drawableoperator= (const Drawable &other)=delete
 
- Public Member Functions inherited from Transformable
 Transformable ()
 Default constructur. More...
 
virtual ~Transformable ()
 Deconstructor. More...
 
Vector2f GetPosition ()
 Returns the position of the object. More...
 
void SetPosition (const Vector2f &position)
 Sets a new position. More...
 
void SetPosition (float x, float y)
 Sets a new position. More...
 
void Move (const Vector2f &position)
 Adds to the current position. More...
 
void Move (float x, float y)
 Adds to the current position. More...
 
Vector2f GetOrigin ()
 Gets the current local origin. More...
 
void SetOrigin (const Vector2f &origin)
 Sets a new local origin. More...
 
void SetOrigin (float x, float y)
 Sets a new local origin. More...
 
Vector2f GetScale ()
 Gets the current scale of the object. More...
 
void SetScale (const Vector2f &scale)
 Sets a new scale. More...
 
void SetScale (float x, float y)
 Sets a new scale. More...
 
void Scale (const Vector2f &scale)
 Scales the object by some amount. More...
 
void Scale (float x, float y)
 Scales the object by some amount. More...
 
float GetRotation ()
 Gets the current rotation. More...
 
void SetRotation (float angle)
 Sets a new rotation. More...
 
void Rotate (float angle)
 Rotates by some amount. More...
 

Protected Member Functions

 Shape ()
 Default constructor. More...
 
- Protected Member Functions inherited from Drawable
 Drawable ()
 
virtual void Draw (SDL_Renderer *const target) const =0
 

Protected Attributes

Color color
 
- Protected Attributes inherited from Transformable
Vector2f position
 Position of the object. More...
 
Vector2f origin
 Offset of the top-left corner from the position. More...
 
Vector2f scale
 Scale of the object. More...
 
float rotation
 Rotation of the object (in degrees) More...
 

Detailed Description

The non-instantiable base class for all SDLU shapes.

Constructor & Destructor Documentation

◆ ~Shape()

virtual Shape::~Shape ( )
virtual

Deconstructor.

◆ Shape()

Shape::Shape ( )
protected

Default constructor.

Member Function Documentation

◆ GetColor()

Color Shape::GetColor ( )

Gets the color of the shape.

◆ SetColor()

void Shape::SetColor ( const Color color)

Sets the color of the shape.

Member Data Documentation

◆ color

Color Shape::color
protected

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