18 std::string title =
"(" + std::to_string(x) +
", " + std::to_string(
y) +
")";
21 bgcolor(Color::HSV(x * 255 / 15, 255,
y * 255 / 15));
25 std::vector<Elements> rows;
26 for (
int i = 0; i < 15; i++) {
27 std::vector<Element> cols;
28 for (
int j = 0; j < 15; j++) {
41 auto slider_x =
Slider(
"x", &focus_x, 0.f, 1.f, 0.01f);
42 auto slider_y =
Slider(
"y", &focus_y, 0.f, 1.f, 0.01f);
50 auto title =
"focusPositionRelative(" +
51 std::to_string(focus_x) +
", " +
52 std::to_string(focus_y) +
")";
65 auto screen = App::Fullscreen();
66 screen.Loop(renderer);
Element make_box(int x, int y)
Component Renderer(Component child, std::function< Element()>)
|child| に似た、|render| をComponent::Render()イベントとして 使用する新しいComponentを返します。
Element text(std::string_view text)
UTF8エンコードされたユニコードテキストを表示します。
Decorator focusPositionRelative(float x, float y)
frame内で使用され、ビューを特定の位置にスクロールさせます。位置は要求されたサイズの割合で表されます。
Decorator size(WidthOrHeight direction, Constraint constraint, int value)
要素のサイズに制約を適用する。
Element flex(Element child)
子要素をコンテナに残されたスペースに比例して拡大させます。
Element bgcolor(Color color, Element child)
要素の背景色を設定します。
Element vbox(Elements children)
要素を縦に一つずつ表示するコンテナ。
std::shared_ptr< Node > Element
Component Slider(SliderOption< T > options)
任意の方向のスライダー。
Element gridbox(std::vector< Elements > lines)
A container displaying a grid of elements.