Class: UIButton
The UIButton class represents a button component in the UI system. It is a specialized subclass of UIComponent that supports callbacks for press and hold events, dynamic colors, and customizable sizes.
Use this class to create interactive buttons in your UI.
The source file for this class is located in os/ui/UIComponents/UIButton.h.
Constructor
UIButton
UIButton() {}
Creates a new button component.
Use the setname, setsize, setcolor/setcolorfunc, onpress, and onhold methods to customize the button.
Methods
GetName
virtual string GetName();
Retrieves the name of the button.
Returns:
string: The name of the button.
SetName
void SetName(string name);
Sets the name of the button.
Parameters:
name(string): The name to assign to the button.
GetColor
virtual Color GetColor();
Gets the current color of the button. If a color function (color_func) is defined, it overrides the static color property.
Returns:
Color: The button's color.
SetColor
void SetColor(Color color);
Sets a static color for the button.
Parameters:
color(Color): The color to assign to the button.