aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-11-27 14:59:03 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-11-27 14:59:03 +0100
commit9d60b7b70abd832dc229c59114e465d457fcd0a3 (patch)
treee8f072ccb8e3a24a42295e53afac1892eda039ab /src/crepe/api
parent6e9879896e620e6113c11e48f23a5f71b4fc87f0 (diff)
make format
Diffstat (limited to 'src/crepe/api')
-rw-r--r--src/crepe/api/Button.cpp9
-rw-r--r--src/crepe/api/Button.h5
-rw-r--r--src/crepe/api/UiObject.cpp5
-rw-r--r--src/crepe/api/UiObject.h2
4 files changed, 15 insertions, 6 deletions
diff --git a/src/crepe/api/Button.cpp b/src/crepe/api/Button.cpp
index 077a5e7..c0ff5a8 100644
--- a/src/crepe/api/Button.cpp
+++ b/src/crepe/api/Button.cpp
@@ -2,7 +2,12 @@
namespace crepe {
-Button::Button(game_object_id_t id, int width, int height, bool is_toggle, std::function<void()> on_click)
- : UiObject(id, width, height), is_toggle(is_toggle), is_pressed(false), hover(false), on_click(on_click) {}
+Button::Button(game_object_id_t id, int width, int height, bool is_toggle,
+ std::function<void()> on_click)
+ : UiObject(id, width, height),
+ is_toggle(is_toggle),
+ is_pressed(false),
+ hover(false),
+ on_click(on_click) {}
} // namespace crepe
diff --git a/src/crepe/api/Button.h b/src/crepe/api/Button.h
index df6f1e0..2fa94ae 100644
--- a/src/crepe/api/Button.h
+++ b/src/crepe/api/Button.h
@@ -1,7 +1,7 @@
#pragma once
-#include <functional>
#include "UiObject.h"
+#include <functional>
namespace crepe {
@@ -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, bool is_toggle = false, std::function<void()> on_click = nullptr);
+ Button(game_object_id_t id, int width, int height, bool is_toggle = false,
+ std::function<void()> on_click = nullptr);
/**
* \brief Indicates if the button is a toggle button (can be pressed and released).
diff --git a/src/crepe/api/UiObject.cpp b/src/crepe/api/UiObject.cpp
index 987fc06..7859a90 100644
--- a/src/crepe/api/UiObject.cpp
+++ b/src/crepe/api/UiObject.cpp
@@ -2,4 +2,7 @@
using namespace crepe;
-UiObject::UiObject(game_object_id_t id,int width,int height) : Component(id),width(width),height(height){};
+UiObject::UiObject(game_object_id_t id, int width, int height)
+ : Component(id),
+ width(width),
+ height(height){};
diff --git a/src/crepe/api/UiObject.h b/src/crepe/api/UiObject.h
index 6b0323e..c056877 100644
--- a/src/crepe/api/UiObject.h
+++ b/src/crepe/api/UiObject.h
@@ -14,7 +14,7 @@ public:
* \brief Constructs a UiObject with the specified game object ID.
* \param id The unique ID of the game object associated with this UI object.
*/
- UiObject(game_object_id_t id,int width,int height);
+ UiObject(game_object_id_t id, int width, int height);
//! The width of the UI object.
int width = 0;