|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
A straight stroke across the width of the entity: a divider, an indicator, the underline of a text field. More...
#include <headers/guillaume/components/line.hpp>


Public Types | |
| enum class | Placement { Center , Top , Bottom } |
| Where the stroke sits across the bound height. More... | |
Public Member Functions | |
| Line (void) | |
| Construct a solid, centered stroke 2 dp thick, with 8 dp dashes and gaps ready for setDashed(), and no color of its own. | |
| ~Line (void)=default | |
| Default destructor for the Line component. | |
| float | getThickness (void) const |
| Get the thickness of the stroke. | |
| Line & | setThickness (float thickness) |
| Set the thickness of the stroke. | |
| bool | isDashed (void) const |
| Check whether the stroke is dashed. | |
| Line & | setDashed (bool dashed) |
| Choose between a solid and a dashed stroke. | |
| float | getDashLength (void) const |
| Get the length of one dash. | |
| Line & | setDashLength (float dashLength) |
| Set the length of one dash. Used only when the stroke is dashed. | |
| float | getGapLength (void) const |
| Get the gap between two dashes. | |
| 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. | |
| Line & | setPlacement (Placement placement) |
| Set where the stroke sits across the height of the bound. | |
| Line & | setColor (const utility::graphic::Color32Bit &color) |
| Give the stroke a color of its own, used in place of the entity's components::Color. | |
| Line & | clearColor (void) |
| Draw the stroke in the entity's components::Color again. | |
| bool | hasColor (void) const |
| Check whether the stroke has a color of its own. | |
| const utility::graphic::Color32Bit & | getColor (void) const |
| Get the color given to setColor(). | |
| Public Member Functions inherited from guillaume::ecs::Component | |
| bool | hasChanged (void) const |
| Tell whether a value of the component changed since the flags were last reset (the end of the previous frame). | |
| void | setHasChanged (bool hasChanged) |
| Raise or lower the changed flag. | |
| Component (void)=default | |
| Create a component that is not marked as changed. | |
| virtual | ~Component (void)=default |
| Virtual destructor, so components can be destroyed through the base class. | |
A straight stroke across the width of the entity: a divider, an indicator, the underline of a text field.
The stroke runs from the left edge to the right edge of the entity's components::Bound. The placement says where it sits across the height (middle, top edge or bottom edge); it can be solid or dashed. The stroke follows the orientation of the entity, so a rotated entity gives a vertical line.
Written by the widget systems that own a stroke (systems::Divider, systems::TextField, ...) or by the application. Read by systems::LineRender in the Render phase, with the entity's Transform, Bound and Color.
|
strong |
|
explicit |
Construct a solid, centered stroke 2 dp thick, with 8 dp dashes and gaps ready for setDashed(), and no color of its own.
Definition at line 27 of file line.cpp.

| Line & guillaume::components::Line::clearColor | ( | void | ) |
Draw the stroke in the entity's components::Color again.
Marks the component changed only when a color was set.
Definition at line 120 of file line.cpp.

| const utility::graphic::Color32Bit & guillaume::components::Line::getColor | ( | void | ) | const |
Get the color given to setColor().
| float guillaume::components::Line::getDashLength | ( | void | ) | const |
| float guillaume::components::Line::getGapLength | ( | void | ) | const |
| Line::Placement guillaume::components::Line::getPlacement | ( | void | ) | const |
| float guillaume::components::Line::getThickness | ( | void | ) | const |
| bool guillaume::components::Line::hasColor | ( | void | ) | const |
Check whether the stroke has a color of its own.
| bool guillaume::components::Line::isDashed | ( | void | ) | const |
| Line & guillaume::components::Line::setColor | ( | const utility::graphic::Color32Bit & | color | ) |
Give the stroke a color of its own, used in place of the entity's components::Color.
This lets one entity carry both a fill (components::Color) and a stroke of another color, such as a filled text field and its underline. Marks the component changed unless the same color was already set.
| color | The stroke color (RGBA). |
Definition at line 109 of file line.cpp.

| Line & guillaume::components::Line::setDashed | ( | bool | dashed | ) |
Choose between a solid and a dashed stroke.
Marks the component changed only when the value differs.
| dashed | True to draw dashes of getDashLength() separated by gaps of getGapLength(). |
Definition at line 55 of file line.cpp.

| Line & guillaume::components::Line::setDashLength | ( | float | dashLength | ) |
Set the length of one dash. Used only when the stroke is dashed.
Marks the component changed only when the value differs.
| dashLength | The dash length, in dp; 0 or less draws a solid stroke. |
Definition at line 70 of file line.cpp.

| Line & guillaume::components::Line::setGapLength | ( | float | gapLength | ) |
Set the gap between two dashes. Used only when the stroke is dashed.
Marks the component changed only when the value differs.
| gapLength | The gap length, in dp; a negative value counts as 0. |
Definition at line 85 of file line.cpp.

Set where the stroke sits across the height of the bound.
A Top or Bottom stroke is also drawn slightly in front of the entity, so it shows over a fill drawn by the same entity. Marks the component changed only when the value differs.
| placement | The placement of the stroke. |
Definition at line 99 of file line.cpp.

| Line & guillaume::components::Line::setThickness | ( | float | thickness | ) |