C4 Engine
C4 Engine API Documentation

class LineWidget

Defined in:  C4Widgets.h
The LineWidget class represents an interface widget that displays a straight line.

class LineWidget final : public StrokableWidget


LineWidget(const Vector2D& size, float thickness, Slug::StrokeCapType capType = Slug::kStrokeCapFlat, const ColorRGBA& color = Color::black);

size The size of the line, in pixels.
thickness The thickness of the stroke, in pixels.
capType The type of caps applied to the stroke.
color The initial color of the line.
The LineWidget class is used to render a straight line segment. Its length is determined by the width of the widget, given by the x component of the size parameter. The y component of the size parameter should normally be set to 1.0, but any positive value is valid and does not affect the appearance of the line.

The line is always rendered horizontally in the widget's local coordinate space. Lines are drawn in different directions by assigning a rotation to the widget's transform.

The default widget color corresponds to the kWidgetColorLine color type. No other color types are supported by the line widget.
Base Classes
StrokableWidget Line widgets are strokes rendered with Slug.
See Also



Wiki Articles

Line Widget