C4 Engine
C4 Engine API Documentation

class RectangleWidget

Defined in:  C4Widgets.h
The RectangleWidget class represents an interface widget that displays a rectangle.

class RectangleWidget : public FillableWidget


RectangleWidget(const Vector2D& size, float thickness, const ColorRGBA& stroke);

RectangleWidget(const Vector2D& size, float thickness, const ColorRGBA& stroke, const ColorRGBA& fill);

RectangleWidget(const Vector2D& size, const ColorRGBA& fill);

size The size of the rectangle, in pixels.
thickness The thickness of the stroke, in pixels.
stroke The initial color of the stroke.
fill The initial color of the fill.
The RectangleWidget class is used to render a rectangle with either square or rounded corners.

If a constructor without the fill parameter is called, then the rectangle has no fill. If a constructor without the thickness and stroke parameters is called, then the rectangle has no stroke.

The default widget color corresponds to the kWidgetColorLine color type. The kWidgetColorFill color types is also supported, and it controls the rectangle's fill color.
Base Classes
FillableWidget Rectangle widgets are composed of fills and strokes rendered with Slug.
See Also



Wiki Articles

Rectangle Widget