Skip to main content

ControlButton

The ControlButton class represents a button control that can be customized with various visual properties such as background, radius, color, stroke style, and gradient style. The class allows for defining callbacks for button interactions, including when the button is pressed, released, or clicked, enabling responsive behavior based on user input.

#include <interface/TellusimControls.h>

Inheritance

Constructors

ControlButton()
explicit ControlButton(Control *parent)
ControlButton(Control *parent, const char *text)
ControlButton(Control *parent, const String &text)

Methods

Background flag.

void setBackground(bool background)
bool getBackground() const

Control mode.

void setButtonMode(Mode mode)
Mode getButtonMode() const

Button radius.

void setButtonRadius(float32_t radius)
float32_t getButtonRadius() const

Button color.

void setButtonColor(Color color)
const Color getButtonColor() const

Stroke style.

void setStrokeStyle(StrokeStyle style)
const StrokeStyle getStrokeStyleConst() const
const StrokeStyle getStrokeStyle() const
StrokeStyle getStrokeStyle()

Gradient style.

void setGradientStyle(GradientStyle style)
const GradientStyle getGradientStyleConst() const
const GradientStyle getGradientStyle() const
GradientStyle getGradientStyle()

Pressed callback.

void setPressedCallback(const PressedCallback &func)
PressedCallback getPressedCallback() const
bool isPressed()

Released callback.

void setReleasedCallback(const ReleasedCallback &func)
ReleasedCallback getReleasedCallback() const
bool isReleased()

Clicked callback.

void setClickedCallback(const ClickedCallback &func)
ClickedCallback getClickedCallback() const
bool isClicked()

Canvas elements.

CanvasRect getCanvasRect()
CanvasMesh getCanvasMesh()

Types

using PressedCallback = Function<void(ControlButton, float32_t x, float32_t y)>
using ReleasedCallback = Function<void(ControlButton, float32_t x, float32_t y)>
using ClickedCallback = Function<void(ControlButton)>