25#include <utility/graphic/color.hpp>
27#include "guillaume/ecs/component.hpp"
75 float _thickness { 2.0f };
76 bool _dashed {
false };
77 float _dashLength { 8.0f };
78 float _gapLength { 8.0f };
80 bool _hasColor {
false };
82 utility::graphic::Color32Bit _color { 0, 0, 0,
196 Line &
setColor(
const utility::graphic::Color32Bit &color);
219 const utility::graphic::Color32Bit &
getColor(
void)
const;
const utility::graphic::Color32Bit & getColor(void) const
Get the color given to setColor().
Line & setThickness(float thickness)
Set the thickness of the stroke.
Line(void)
Construct a solid, centered stroke 2 dp thick, with 8 dp dashes and gaps ready for setDashed(),...
float getDashLength(void) const
Get the length of one dash.
Line & setDashed(bool dashed)
Choose between a solid and a dashed stroke.
~Line(void)=default
Default destructor for the Line component.
bool isDashed(void) const
Check whether the stroke is dashed.
float getGapLength(void) const
Get the gap between two dashes.
Line & setPlacement(Placement placement)
Set where the stroke sits across the height of the bound.
Line & setDashLength(float dashLength)
Set the length of one dash. Used only when the stroke is dashed.
Line & setGapLength(float gapLength)
Set the gap between two dashes. Used only when the stroke is dashed.
Placement getPlacement(void) const
Get where the stroke sits across the height of the bound.
Placement
Where the stroke sits across the bound height.
@ Center
Half-way down the bound (dividers, indicators).
@ Top
Inside the bound, against its top edge.
Line & clearColor(void)
Draw the stroke in the entity's components::Color again.
Line & setColor(const utility::graphic::Color32Bit &color)
Give the stroke a color of its own, used in place of the entity's components::Color.
float getThickness(void) const
Get the thickness of the stroke.
bool hasColor(void) const
Check whether the stroke has a color of its own.
Base class of every component: a piece of state attached to an entity, plus a "changed" flag.
State. Every class here is plain data attached to an entity.