18 std::string title =
"(" + std::to_string(x) +
", " + std::to_string(y) +
")";
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 =
"焦點相對位置(" +
51 std::to_string(focus_x) +
", " +
52 std::to_string(focus_y) +
")";
66 screen.Loop(renderer);
Element make_box(int x, int y)
static ScreenInteractive Fullscreen()
Component Renderer(Component child, std::function< Element()>)
回傳一個新的元件,類似於 |child|,但使用 |render| 作為 Component::Render() 事件。
virtual void Render(Screen &screen)
Decorator bgcolor(Color)
使用背景顏色進行裝飾。
Decorator focusPositionRelative(float x, float y)
在 frame 內部使用,這會強制視圖滾動到給定位置。該位置以請求大小的比例表示。
Decorator size(WidthOrHeight, Constraint, int value)
限制元素的大小。
Element flex(Element)
使子元素按比例擴展以佔據容器中剩餘的空間。
Element text(std::wstring text)
顯示一段 Unicode 文字。
Element separator()
在兩個元素之間繪製垂直或水平分隔線。
Element vbox(Elements)
一個垂直一個接一個顯示元素的容器。
static Color HSV(uint8_t hue, uint8_t saturation, uint8_t value)
從 HSV 表示建立一個顏色。 https://en.wikipedia.org/wiki/HSL_and_HSV
std::shared_ptr< Node > Element
Component Slider(SliderOption< T > options)
Element gridbox(std::vector< Elements > lines)
顯示元素網格的容器。