46 int width,
int height,
char c,
char* ansi,
int z,
66 return button->sprite;
69 int draw(
int x,
int y) {
77 bool isHidden()
const {
89 int setData(
char** data,
char*** ansi) {
102 std::vector<std::string> data,
103 std::vector<std::vector<std::string>> ansi
108 int moveTo(
int x,
int y) {
112 int moveBy(
int dx,
int dy) {
128 std::vector<std::unique_ptr<Button>> buttonList;
129 buttonList.reserve(count);
131 for (
int i = 0; i < count; i++) {
132 if (buttons[i] !=
nullptr) {
133 buttonList.emplace_back(std::make_unique<Button>(buttons[i]));
140int getRegisteredButtonsCount() {
144std::vector<std::unique_ptr<Button>> getAllButtonsAt(
int x,
int y) {
146 if (buttons ==
nullptr)
return {};
148 std::vector<std::unique_ptr<Button>> buttonList;
149 for (
int i = 0; buttons[i] !=
nullptr; i++) {
150 buttonList.emplace_back(std::make_unique<Button>(buttons[i]));
157std::unique_ptr<Button> getButtonAt(
int x,
int y) {
159 if (button ==
nullptr)
return nullptr;
161 return std::make_unique<Button>(button);
C++ Extensions for the Builder API.
A C++ wrapper around a CmdFX_Sprite struct.
Definition sprites.hpp:33
CmdFX_Sprite * getSprite()
Get the Sprite object associated with this class.
Definition sprites.hpp:60
C++ wrapper for the CmdFX canvas.
Definition canvas.hpp:25
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:124
Primary namespace for CmdFX.
Definition cmdfx.hpp:26
char ** to2DArray(std::vector< std::string > string)
Converts a 1D vector of strings to a 2D array of characters.
Definition builder.hpp:64
char *** to3DArray(std::vector< std::vector< std::string > > string)
Converts a 2D vector of strings to a 3D array of characters.
Definition builder.hpp:80
C++ Extensions for the CmdFX Sprites API.
Represents a sprite that can be drawn to the terminal.
Definition sprites.h:31