Turbo Engine 0.3
A C++ game engine using Allegro 5
turbo::RectangleShape Class Reference

Represents a drawable rectangle. More...

#include <RectangleShape.hpp>

Inheritance diagram for turbo::RectangleShape:
Collaboration diagram for turbo::RectangleShape:

Public Member Functions

 RectangleShape (const Vector2< unsigned int > &size, const Color &color=Color())
 RectangleShape (unsigned int width, unsigned int height, const Color &color=Color())
void draw () const override
 Draw the drawable -_-.

Public Attributes

bool is_filled = true
 Is filled or only borders ?
float thickness = 1.0f
 Thickness of the border is is_filled is false.
float border_radius = 0.0f
 Border radius of the rectangle.
Color color = Color()
 Color of the shape.
Vector2< unsigned int > size
 size of the rectangle in pixels

Detailed Description

Represents a drawable rectangle.

Constructor & Destructor Documentation

◆ RectangleShape() [1/2]

turbo::RectangleShape::RectangleShape ( const Vector2< unsigned int > & size,
const Color & color = Color() )

◆ RectangleShape() [2/2]

turbo::RectangleShape::RectangleShape ( unsigned int width,
unsigned int height,
const Color & color = Color() )

Member Function Documentation

◆ draw()

void turbo::RectangleShape::draw ( ) const
overridevirtual

Draw the drawable -_-.

Implements turbo::Drawable.

Member Data Documentation

◆ border_radius

float turbo::RectangleShape::border_radius = 0.0f

Border radius of the rectangle.

Note
trigger runtime exception if negative

◆ color

Color turbo::RectangleShape::color = Color()

Color of the shape.

◆ is_filled

bool turbo::RectangleShape::is_filled = true

Is filled or only borders ?

◆ size

Vector2<unsigned int> turbo::RectangleShape::size

size of the rectangle in pixels

◆ thickness

float turbo::RectangleShape::thickness = 1.0f

Thickness of the border is is_filled is false.

Note
trigger runtime exception if negative

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