59 return button->sprite;
62 int draw(
int x,
int y) {
70 bool isHidden()
const {
82 int setData(
char** data,
char*** ansi) {
92 int setData(std::vector<std::string> data, std::vector<std::vector<std::string>> ansi) {
96 int moveTo(
int x,
int y) {
100 int moveBy(
int dx,
int dy) {
114 std::vector<std::unique_ptr<Button>> buttonList;
115 buttonList.reserve(count);
117 for (
int i = 0; i < count; i++) {
118 if (buttons[i] !=
nullptr) {
119 buttonList.emplace_back(std::make_unique<Button>(buttons[i]));
126 int getRegisteredButtonsCount() {
130 std::vector<std::unique_ptr<Button>> getAllButtonsAt(
int x,
int y) {
132 if (buttons ==
nullptr)
return {};
134 std::vector<std::unique_ptr<Button>> buttonList;
135 for (
int i = 0; buttons[i] !=
nullptr; i++) {
136 buttonList.emplace_back(std::make_unique<Button>(buttons[i]));
143 std::unique_ptr<Button> getButtonAt(
int x,
int y) {
145 if (button ==
nullptr)
return nullptr;
147 return std::make_unique<Button>(button);
C++ Extensions for the Builder API.
A C++ wrapper around a CmdFX_Sprite struct.
Definition sprites.hpp:32
CmdFX_Sprite * getSprite()
Get the Sprite object associated with this class.
Definition sprites.hpp:53
C++ wrapper for the CmdFX canvas.
Definition canvas.hpp:23
std::vector< std::unique_ptr< Button > > getRegisteredButtons()
Gets all registered buttons in the UI manager as a vector of unique_ptr<Button>.
Definition button.hpp:110
Primary namespace for CmdFX.
Definition cmdfx.hpp:22
char ** to2DArray(std::vector< std::string > string)
Converts a 1D vector of strings to a 2D array of characters.
Definition builder.hpp:39
char *** to3DArray(std::vector< std::vector< std::string > > string)
Converts a 2D vector of strings to a 3D array of characters.
Definition builder.hpp:55
C++ Extensions for the CmdFX Sprites API.
Represents a sprite that can be drawn to the terminal.
Definition sprites.h:30