MayaFlux 0.4.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) } 
)

Press text into a new GPU texture and bind it to the attached FormaBuffer.

The VKImage is retained internally for subsequent set_text() calls.

buffer must already be set and created with an additional_textures slot at index 0.

Parameters
textUTF-8 string to composite.
paramsPressParams (color, render_bounds, atlas, budget_h). Defaults apply when omitted.
regionNDC quad extent. Defaults to fullscreen.

Definition at line 51 of file Element.cpp.

55{
56 if (!buffer)
57 return *this;
58
59 if (!params.has_value())
60 params = Portal::Text::PressParams {};
61
62 texture = Portal::Text::press(text, params->render_bounds, *params);
63 buffer->submit(textured_mesh_rect(region));
64 buffer->bind_texture(0, texture);
65 return *this;
66}
std::shared_ptr< Buffers::TextBuffer > press(std::string_view text, const PressParams &params)
Composite a UTF-8 string into a new TextBuffer.
Definition InkPress.cpp:237
std::shared_ptr< Core::VKImage > texture
Optional GPU texture to bind to the attached buffer. Used for.
Definition Element.hpp:75
std::shared_ptr< Buffers::FormaBuffer > buffer
Buffer whose rendered output occupies this region.
Definition Element.hpp:72

References buffer, MayaFlux::Portal::Text::press(), and texture.

Referenced by MayaFlux::Portal::Forma::Plot::place_label().

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