Jazz2::UI::Windows::WrappedLabel class

Text on as many lines as it needs in the width it gets.

A label would be cut off. Lines are broken at spaces and new lines, a word wider than the width gets a line of its own. It's always aligned to the left.

Base classes

class Label
Text.

Constructors, destructors, conversion operators

WrappedLabel(StringView text = {}, const Colorf& color = Theme::Text) explicit
Creates a new instance.

Public functions

auto Measure(const Context& context, Vector2f available) -> Vector2f override
Returns the size the element wants, in pixels.
auto MeasureDependsOnAvailable() const -> bool override
Returns false if what Measure() returns doesn't depend on the available size, it's measured once a frame then.
void Draw(Painter& painter) override
Draws the element and its children.

Function documentation

Vector2f Jazz2::UI::Windows::WrappedLabel::Measure(const Context& context, Vector2f available) override

Returns the size the element wants, in pixels.

The available size is what the parent can give, a size without limit is a very large number.