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

◆ add_text_row()

std::pair< uint32_t, std::shared_ptr< Element > > MayaFlux::Portal::Forma::internal::add_text_row ( Surface &  surface,
std::string_view  label,
Kinesis::AABB2D  bounds,
glm::uvec2  dims,
const std::shared_ptr< Buffers::FormaBuffer > &  batch = {} 
)

Register a clickable text row on surface.

Draws label over the idle background and adds the element to the surface's layer. The row is a slice of batch when one is given, so rows that share a buffer draw together; otherwise it gets a buffer of its own.

Parameters
surfaceSurface to register on.
labelRow text.
boundsNDC region of the row.
dimsPixel size to lay the text out at.
batchText-capable buffer to draw into as a slice, or empty.
Returns
Element id on the layer, and the row element for later set_text().

Definition at line 28 of file TextRow.cpp.

34{
35 FormaTarget buf = batch
36 ? FormaTarget::slice_of(batch, Graphics::PrimitiveTopology::TRIANGLE_LIST)
38 surface.render_config({ .additional_textures = { { "text", nullptr } } })));
39
40 auto row = std::make_shared<Element>();
41 row->with_name(std::string(label))
42 .with_bounds(bounds)
43 .with_buffer(buf)
44 .with_text(row_caption(label), row_press_params(dims, row_idle_color()), bounds);
45
46 return { surface.add(*row), row };
47}
uint32_t label
Definition Contours.cpp:16
Where an element's geometry and texture are written.
Definition Target.hpp:22
Layer::Slot add(Element element)
Forward an Element to layer().add() and return the Slot.
Definition Surface.hpp:210
Atelier & atelier()
Accessor for the process-wide Atelier.
Definition Atelier.hpp:304
auto create_buffer(uint32_t channel, uint32_t buffer_size, Args &&... args) -> std::shared_ptr< BufferType >
creates a new buffer of the specified type and registers it
Definition Graph.hpp:340

References atelier(), MayaFlux::Portal::Forma::create_buffer(), MayaFlux::Portal::Forma::Surface::render_config(), MayaFlux::Portal::Forma::FormaTarget::slice_of(), and MayaFlux::Portal::Graphics::TRIANGLE_LIST.

Referenced by MayaFlux::Portal::Forma::Dropdown::place().

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