Loading...
Searching...
No Matches
ml::DynamicPanel::Builder Class Reference

#include <Malena/Graphics/Layouts/DynamicPanel.h>

Public Member Functions

RectangleButtonbutton (const std::string &label, float x, float y, float w, float h, int style, std::function< void()> onClick)
TextInputinput (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)
RectangleButtonrect (float x, float y, float w, float h, const sf::Color &fill)
 A non-interactive coloured rectangle (decor / background / divider).
Texttext (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

Detailed Description

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.

Member Function Documentation

◆ button()

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.

◆ input()

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.

◆ rect()

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()

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.

◆ DynamicPanel

friend class DynamicPanel
friend

Definition at line 53 of file DynamicPanel.h.


The documentation for this class was generated from the following file: