Dualie
Loading...
Searching...
No Matches
Shape.hpp
1//
2// Created by caleb on 6/16/24.
3//
4
5#ifndef DUALIE_SHAPE_HPP
6#define DUALIE_SHAPE_HPP
7
8
9#include <Dualie/Graphics/Color.hpp>
10#include <Dualie/Graphics/Transformable.hpp>
11#include <Dualie/Graphics/Drawable.hpp>
12#include <Dualie/System/Rect.hpp>
13
14namespace dl {
15
19 class Shape : public dl::Transformable, public dl::Drawable {
20
21 protected:
22 dl::Color m_fillColor;
23 dl::Color m_outlineColor;
24 float m_outlineThickness;
25 dl::Vector2f m_origin;
26 dl::Vector2f m_size;
27
28 public:
29 Shape();
30
35 void setFillColor(const dl::Color& color);
36
41 void setOutlineColor(const dl::Color& color);
42
47 void setOutlineThickness(float thickness);
48
55 void setOrigin(const dl::Vector2f& origin);
56
64 void setOrigin(float x, float y);
65
69 const dl::Vector2f& getSize();
70
74 const dl::Vector2f& getOrigin();
75
80
85
89 const Color &getFillColor() const;
90
94 const Color &getOutlineColor() const;
95
99 const float& getOutlineThickness();
100
101 };
102}
103
104
105#endif //DUALIE_SHAPE_HPP
A class used to describe a RGBA color.
Definition Color.hpp:19
The base class for any object that can be drawn to the screen.
Definition Drawable.hpp:15
The base class for any shape.
Definition Shape.hpp:19
void setOutlineColor(const dl::Color &color)
Sets the outline color of the shape.
Definition Shape.cpp:31
const float & getOutlineThickness()
Definition Shape.cpp:57
void setOrigin(const dl::Vector2f &origin)
Sets the origin of the shape. The default origin is (0,0) and is the top left pixel of the shape boun...
Definition Shape.cpp:14
dl::FloatRect getLocalBounds()
Definition Shape.cpp:23
void setOutlineThickness(float thickness)
Sets the outline thickness of the shape.
Definition Shape.cpp:36
void setFillColor(const dl::Color &color)
Sets the fill color of the shape.
Definition Shape.cpp:10
const dl::Vector2f & getSize()
Definition Shape.cpp:42
const Color & getOutlineColor() const
Definition Shape.cpp:51
dl::FloatRect getGlobalBounds()
Definition Shape.cpp:27
const dl::Vector2f & getOrigin()
Definition Shape.cpp:64
const Color & getFillColor() const
Definition Shape.cpp:46
A base class for anything that has a position on the screen.
Definition Transformable.hpp:16