![]() |
cmdfx 0.2.1
Lightweight game engine for your terminal
|
A C++ wrapper around the CmdFX_Button struct for switch buttons. More...
#include <switch.hpp>
Public Member Functions | |
Switch (CmdFX_Button *btn) | |
Switch (Sprite &sprite, CmdFX_ButtonCallback callback, bool state=false) | |
Switch (std::vector< std::string > &on, std::vector< std::string > &off, std::vector< std::vector< std::string > > &ansiOn, std::vector< std::vector< std::string > > &ansiOff, CmdFX_ButtonCallback callback, bool state=false) | |
bool | isOn () const |
void | setOn (bool state) |
void | toggle () |
![]() | |
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 for switch buttons.
This class represents a switch button in the CmdFX UI system. It provides methods to interact with the switch, such as toggling its state and checking if it is on or off.