27class SceneButtons final {
32 SceneButtons(
int uid) : sceneUid(uid) {
49 std::vector<std::unique_ptr<Button>> buttonList;
50 buttonList.reserve(count);
52 for (
int i = 0; i < count; i++) {
53 if (buttons[i] !=
nullptr) {
54 buttonList.emplace_back(std::make_unique<Button>(buttons[i]));
61 std::vector<int> getButtonCoordinates(
int index,
Button& button) {
63 if (coords ==
nullptr)
return {-1, -1};
65 std::vector<int> coordinates = {coords[0], coords[1]};
69 int addButton(Button& button,
int x,
int y) {
73 int removeButton(Button& button) {
77 int removeButtonAt(
int x,
int y) {
81 int removeAllButtons() {
A C++ wrapper around a CmdFX_Scene struct.
Definition scenes.hpp:33
int getUniqueId() const
Gets the unique identifier of the scene.
Definition scenes.hpp:99
C++ Extensions for the CmdFX Scenes API.
Primary namespace for CmdFX.
Definition cmdfx.hpp:26
UI extensions for Scenes in CmdFX.
CmdFX_Button ** Scene_getButtons(int uid)
Gets the buttons of a scene.
int Scene_getButtonsCount(int uid)
Gets the number of buttons in a scene.
int Scene_removeButtonAt(int uid, int x, int y)
Removes a button from a scene at the specified coordinates.
int Scene_removeAllButtons(int uid)
Removes all buttons from a scene.
int Scene_removeButton(int uid, CmdFX_Button *button)
Removes a button from a scene.
int Scene_addButton(int uid, CmdFX_Button *button, int x, int y)
Adds a button to a scene.
int * Scene_getButtonCoordinates(int uid, CmdFX_Button *button)
Gets the coordinates of a button in a scene.