cmdfx 0.2.1
Lightweight game engine for your terminal
Loading...
Searching...
No Matches
CmdFX::Switch Class Reference

A C++ wrapper around the CmdFX_Button struct for switch buttons. More...

#include <switch.hpp>

Inheritance diagram for CmdFX::Switch:
CmdFX::Button

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 ()
 
- Public Member Functions inherited from CmdFX::Button
 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_ButtongetButton () const
 
CmdFX_SpritegetSprite () 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)
 

Detailed Description

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.


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