26 class SceneButtons final {
31 SceneButtons(
int uid) : sceneUid(uid) {}
43 std::vector<std::unique_ptr<Button>> buttonList;
44 buttonList.reserve(count);
46 for (
int i = 0; i < count; i++) {
47 if (buttons[i] !=
nullptr) {
48 buttonList.emplace_back(std::make_unique<Button>(buttons[i]));
55 std::vector<int> getButtonCoordinates(
int index,
Button& button) {
57 if (coords ==
nullptr)
return { -1, -1 };
59 std::vector<int> coordinates = { coords[0], coords[1] };
63 int addButton(Button& button,
int x,
int y) {
67 int removeButton(Button& button) {
71 int removeButtonAt(
int x,
int y) {
75 int removeAllButtons() {
A C++ wrapper around a CmdFX_Scene struct.
Definition scenes.hpp:32
int getUniqueId() const
Gets the unique identifier of the scene.
Definition scenes.hpp:90
C++ Extensions for the CmdFX Scenes API.
Primary namespace for CmdFX.
Definition cmdfx.hpp:22
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.