Skip to main content

Module label

Module label 

Source
Expand description

Label — static text display widget.

Labels are non-interactive by design (hit_test always returns false and on_event always returns Ignored). This makes them safe to use as transparent overlay children inside interactive parents like Button — the parent retains full hit-test and focus ownership.

§Backbuffer

When buffered is true AND the active DrawCtx supports image blitting (ctx.has_image_blit() returns true, i.e. the software GfxCtx path), the label pre-renders its glyphs into an offscreen Framebuffer on the first paint() call — or whenever text, font_size, color, or bounds change — and blits the cached pixels every subsequent frame via ctx.draw_image_rgba(). No font shaping or rasterisation occurs on cache hits.

On the GL path (has_image_blit() → false) the label falls back to the direct fill_text() call; the GL path’s GlyphCache provides equivalent glyph-level savings there.

Structs§

Label
A non-interactive text widget.

Enums§

LabelAlign
Horizontal alignment for Label text.