diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-28 09:02:02 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-28 09:02:02 +0100 |
commit | 34218886689a57004576486976038027732d8bcc (patch) | |
tree | 28eb5b594920fbb3c668564e01818bfa50b6fc56 /src/crepe/api | |
parent | 570acb7e9258edcd6a06fff4dd2ce0ff12a3e873 (diff) |
make format
Diffstat (limited to 'src/crepe/api')
-rw-r--r-- | src/crepe/api/Button.cpp | 4 | ||||
-rw-r--r-- | src/crepe/api/Button.h | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/crepe/api/Button.cpp b/src/crepe/api/Button.cpp index a27ff53..d325014 100644 --- a/src/crepe/api/Button.cpp +++ b/src/crepe/api/Button.cpp @@ -2,8 +2,8 @@ namespace crepe { -Button::Button(game_object_id_t id, int width, int height, std::function<void()> on_click, bool is_toggle - ) +Button::Button(game_object_id_t id, int width, int height, std::function<void()> on_click, + bool is_toggle) : UiObject(id, width, height), is_toggle(is_toggle), on_click(on_click) {} diff --git a/src/crepe/api/Button.h b/src/crepe/api/Button.h index 1410529..18f3def 100644 --- a/src/crepe/api/Button.h +++ b/src/crepe/api/Button.h @@ -24,7 +24,8 @@ public: * \param is_toggle Optional flag to indicate if the button is a toggle button. Defaults to false. * \param on_click callback function that will be invoked when the button is clicked. */ - Button(game_object_id_t id, int width, int height, std::function<void()> on_click, bool is_toggle = false); + Button(game_object_id_t id, int width, int height, std::function<void()> on_click, + bool is_toggle = false); /** * \brief Indicates if the button is a toggle button (can be pressed and released). @@ -41,7 +42,7 @@ public: * function that matches the signature `void()`. */ std::function<void()> on_click; - + /** * \brief Callback function to be executed when the mouse enters the button's boundaries. * @@ -57,7 +58,8 @@ public: * allowing custom actions like resetting visual effects or playing exit-related effects. */ std::function<void()> on_exit; - private: + +private: friend class InputSystem; /** * \brief Indicates whether the button is currently pressed. |