|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
| MAYAFLUX_API TextField MayaFlux::Portal::Forma::create_text_field | ( | Surface & | surface, |
| Kinesis::AABB2D | bounds, | ||
| std::shared_ptr< Portal::Text::PressParams > | params = nullptr, |
||
| std::string | initial_text = {}, |
||
| bool | scrollable = false |
||
| ) |
Build a text-capable FormaBuffer, register a TextField, and wire text editing onto it in one call.
The one-call convenience over TextField::place(), the same split Portal::Forma::create<T> already has with a bare Form<T>. This builds the buffer (create_buffer, which TextField.cpp itself may never call; see TextField.hpp) and delegates. Build the buffer and TextField by hand instead for anything needing a non-default buffer setup (a shared texture slot alongside a background quad, for instance).
scrollable composes a second primitive in, the same way: false (the default) matches every prior call exactly, and bounds is the field's own region. True builds a plain Scrollable and places its viewport and the field text in slices of one text-capable buffer, then calls TextField::scrollable() instead of place(). This is the same composition test_text_input() (test_8.hpp) once wired by hand, now living at the TextField primitive level; this is only the one-call convenience over it. That Scrollable is local to this call and not returned, so no indicator is added and nothing else can be tracked into the same viewport. Build the Scrollable yourself and call TextField::scrollable() directly (or place() + Scrollable::track() by hand) for either of those.
| surface | Surface whose window, layer, and context own the field. |
| bounds | NDC region for both hit testing and the text quad, or, when scrollable, the fixed clipped viewport. |
| params | Shared render params. A default-constructed one is allocated if null. |
| initial_text | Starting text. Cursor starts at its end. |
| scrollable | When true, wraps the field in a Scrollable viewport. |
scrollable is true. No manual multi-id cleanup is needed. Definition at line 15 of file Tend.cpp.
References create_text_field(), MayaFlux::Portal::Forma::TextField::place(), MayaFlux::Portal::Forma::Scrollable::place(), and MayaFlux::Portal::Forma::TextField::scrollable().
Referenced by create_text_field().
Here is the call graph for this function:
Here is the caller graph for this function: