aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Script.cpp
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-20 12:17:14 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-20 12:17:14 +0100
commit18c7e528f3df31d62cd05c2cc34be92be83d5367 (patch)
tree800cc0fc41750c31a95de09dc2fc2207d0ed7469 /src/crepe/api/Script.cpp
parent03aea832aa0bc2edba2cc5ab4d9f8eba42d355be (diff)
button now using channel
Diffstat (limited to 'src/crepe/api/Script.cpp')
-rw-r--r--src/crepe/api/Script.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/crepe/api/Script.cpp b/src/crepe/api/Script.cpp
index b147252..06b535f 100644
--- a/src/crepe/api/Script.cpp
+++ b/src/crepe/api/Script.cpp
@@ -20,6 +20,21 @@ void Script::subscribe(const EventHandler<CollisionEvent> & callback) {
this->subscribe_internal(callback, this->game_object_id);
}
+template <>
+void Script::subscribe(const EventHandler<ButtonExitEvent> & callback) {
+ this->subscribe_internal(callback, this->game_object_id);
+}
+
+template <>
+void Script::subscribe(const EventHandler<ButtonPressEvent> & callback) {
+ this->subscribe_internal(callback, this->game_object_id);
+}
+
+template <>
+void Script::subscribe(const EventHandler<ButtonEnterEvent> & callback) {
+ this->subscribe_internal(callback, this->game_object_id);
+}
+
void Script::set_next_scene(const string & name) {
SceneManager & mgr = this->mediator->scene_manager;
mgr.set_next_scene(name);