aboutsummaryrefslogtreecommitdiff
path: root/game/mainmenu/ButtonSubScene.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game/mainmenu/ButtonSubScene.cpp')
-rw-r--r--game/mainmenu/ButtonSubScene.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/game/mainmenu/ButtonSubScene.cpp b/game/mainmenu/ButtonSubScene.cpp
new file mode 100644
index 0000000..168b387
--- /dev/null
+++ b/game/mainmenu/ButtonSubScene.cpp
@@ -0,0 +1,20 @@
+#include "ButtonSubScene.h"
+#include "ButtonScript.h"
+
+#include <crepe/api/BehaviorScript.h>
+#include <crepe/api/Sprite.h>
+#include <crepe/api/Scene.h>
+#include <crepe/api/Button.h>
+
+using namespace crepe;
+using namespace std;
+
+void ButtonSubScene::create(Scene & scn){
+ GameObject button_object = scn.new_object("button");
+ button_object.add_component<Button>(vec2{100,100},vec2{0,0});
+ button_object.add_component<Sprite>(Asset("asset/coin/coin_64.png"),Sprite::Data{
+ .size = vec2{100,100},
+ });
+ button_object.add_component<BehaviorScript>().set_script<ButtonScript>();
+}
+