4#include "flint/graphics/drawable.h"
5#include "flint/graphics/texture.h"
6#include "flint/graphics/types/color.h"
7#include "flint/math/types.h"
22 ~Shape()
override =
default;
30 m_position = newPosition;
48 m_outlineColor = color;
57 m_outlineThickness = thickness;
72 return m_outlineColor;
77 return m_outlineThickness;
90 return FloatRect({m_position.x, m_position.y},
91 {
static_cast<float>(m_texture ? m_texture->
getWidth() : 0),
92 static_cast<float>(m_texture ? m_texture->
getHeight() : 0)});
96 Vec2f m_position{0, 0};
97 Color m_fillColor{255, 255, 255, 255};
98 Color m_outlineColor{0, 0, 0, 0};
99 float m_outlineThickness{0.f};
102 Texture *m_texture =
nullptr;
Interface for objects that contribute ordered work to a rendered frame.
virtual FloatRect getGlobalBounds() const
Return the axis-aligned bounding rectangle in world space.
virtual Color getFillColor() const
Return the current fill color.
virtual void setOutlineThickness(float thickness)
Set the outline stroke thickness in pixels.
virtual float getOutlineThickness() const
Return the current outline thickness in pixels.
virtual Color getOutlineColor() const
Return the current outline color.
virtual void setFillColor(Color color)
Set the fill (interior) color.
virtual Vec2f getPosition() const
Return the current world-space position.
virtual void setPosition(Vec2f newPosition)
Set the world-space position of the shape.
virtual void setOutlineColor(Color color)
Set the outline (stroke) color.
Abstract base class for 2-D geometric shapes.
int getWidth() const
Return the texture width in pixels.
int getHeight() const
Return the texture height in pixels.
RGBA color with 8-bit unsigned components.