Expand description
Caption block — wrapped text on top of a rounded rect background (M-TEXT.9 / AUT-83).
Composition only; no new shaders. Layout works in NDC throughout:
- Construct a
CaptionBlockwithtext,style,max_width_ndc, andpadding_ndc. - Call
CaptionBlock::layoutwith thecrate::text::TextTexturePipelineto measure the text and produce a list of scene nodes:- a background
Graphicsrounded rect sized to the wrapped text + padding; - a
Spritecarrying the rendered text texture, positioned inside the padding rect.
- a background
- Caller attaches both nodes to a
Container(or directly to the stage); the container’s transform handles position.
Honors WispTextStyle::align (the text texture itself respects
the style’s alignment) and line_height (cosmic-text handles
wrap + line metrics).
Structs§
- Caption
Block - Builder for a wrapped caption block with a rounded-rect background.
- Caption
Layout - Result of laying out a
CaptionBlock.