MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ with_text()

Element & MayaFlux::Portal::Forma::Element::with_text ( std::string_view  text,
std::optional< Portal::Text::PressParams >  params,
Kinesis::AABB2D  region = { .min = glm::vec2(-1.F), .max = glm::vec2(1.F) } 
)

Draw text as glyph quads into the attached buffer.

The glyphs are sampled from the glyph atlas, which is bound at texture slot 0, so buffer must already be set and created with an additional_textures slot at index 0. The text is retained for subsequent set_text() and retarget() calls.

Parameters
textUTF-8 string to draw.
paramsPressParams (color, spans, background, render_bounds, atlas). render_bounds is the layout size in pixels, fitted onto region. Defaults apply when omitted.
regionNDC extent. Defaults to fullscreen.

Definition at line 41 of file Element.cpp.

45{
46 if (!buffer)
47 return *this;
48
50 buffer, region, params.value_or(Portal::Text::PressParams {}), text);
51 return *this;
52}
static std::shared_ptr< TextSlice > make(FormaTarget target, Kinesis::AABB2D bounds, Text::PressParams params, std::string_view text)
Draw text in bounds on target.
Definition TextSlice.cpp:49
FormaTarget buffer
Where this region's rendered output is written: a buffer of its own, or a slice of one it shares.
Definition Element.hpp:82
std::shared_ptr< internal::TextSlice > text_slice
Text drawn into the attached buffer by with_text().
Definition Element.hpp:89

References buffer, MayaFlux::Portal::Forma::internal::TextSlice::make(), and text_slice.

Referenced by MayaFlux::Portal::Forma::TextField::place(), and MayaFlux::Portal::Forma::Plot::place_label().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: