![]() |
cmdfx 0.2.1
Lightweight game engine for your terminal
|
A C++ wrapper around the CmdFX_Button struct. More...
#include <button.hpp>
Public Member Functions | |
Button (CmdFX_Button *btn) | |
Button (Sprite &sprite, CmdFX_ButtonCallback callback) | |
Button (int width, int height, char c, char *ansi, int z, CmdFX_ButtonCallback callback) | |
CmdFX_Button * | getButton () const |
CmdFX_Sprite * | getSprite () const |
Gets the value of the button's sprite. | |
int | draw (int x, int y) |
int | remove () |
bool | isHidden () const |
int | hide () |
int | show () |
int | setData (char **data, char ***ansi) |
int | setData (std::vector< std::string > data, std::vector< std::vector< std::string > > ansi) |
Sets the data for the button using vectors. | |
int | moveTo (int x, int y) |
int | moveBy (int dx, int dy) |
A C++ wrapper around the CmdFX_Button struct.
This class represents a button in the CmdFX UI system. It provides methods to interact with the button, such as setting data, showing, hiding, and checking if the button is hidden. The button will be freed automatically when the Button object is destroyed.
|
inline |
Gets the value of the button's sprite.
|
inline |
Sets the data for the button using vectors.
data | A 1D vector of strings representing the data to set for the button. |
ansi | A 2D vector of strings representing the ANSI escape codes to apply to the data. |