#include <Malena/Graphics/Layouts/DynamicPanel.h>
Public Member Functions | |
| RectangleButton & | button (const std::string &label, float x, float y, float w, float h, int style, std::function< void()> onClick) |
| TextInput & | input (const std::string &id, const std::string &placeholder, float x, float y, float w, float h, const std::string &value, std::function< void(const std::string &)> onChange) |
| RectangleButton & | rect (float x, float y, float w, float h, const sf::Color &fill) |
| A non-interactive coloured rectangle (decor / background / divider). | |
| Text & | text (const std::string &s, float x, float y, unsigned size, const sf::Color &color, bool center=false) |
| A label. Pass center=true to horizontally centre it on x. | |
Friends | |
| class | DynamicPanel |
The builder handed to your onBuild callback. Each call reuses a pooled widget positioned RELATIVE to the panel's own origin.
Definition at line 50 of file DynamicPanel.h.
| RectangleButton & ml::DynamicPanel::Builder::button | ( | const std::string & | label, |
| float | x, | ||
| float | y, | ||
| float | w, | ||
| float | h, | ||
| int | style, | ||
| std::function< void()> | onClick ) |
A clickable button. style is passed to the styler set via setButtonStyler (0 if none set); the callback replaces any prior one.
| TextInput & ml::DynamicPanel::Builder::input | ( | const std::string & | id, |
| const std::string & | placeholder, | ||
| float | x, | ||
| float | y, | ||
| float | w, | ||
| float | h, | ||
| const std::string & | value, | ||
| std::function< void(const std::string &)> | onChange ) |
A text field, keyed by a STABLE id so the same physical input survives rebuilds (focus/typing preserved). value seeds the field only when it isn't focused (never clobbers typing); onChange replaces any prior one.
| RectangleButton & ml::DynamicPanel::Builder::rect | ( | float | x, |
| float | y, | ||
| float | w, | ||
| float | h, | ||
| const sf::Color & | fill ) |
A non-interactive coloured rectangle (decor / background / divider).
| Text & ml::DynamicPanel::Builder::text | ( | const std::string & | s, |
| float | x, | ||
| float | y, | ||
| unsigned | size, | ||
| const sf::Color & | color, | ||
| bool | center = false ) |
A label. Pass center=true to horizontally centre it on x.
|
friend |
Definition at line 53 of file DynamicPanel.h.