aboutsummaryrefslogtreecommitdiff
path: root/game/mainmenu/ButtonSubScene.h
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-12-22 00:11:56 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-12-22 00:11:56 +0100
commit7bcee4f662b20b8e2e7183bb6bd4cb061fa14e12 (patch)
treecb7976922b3cc6070dc9c14d0ffcaea48b3efee6 /game/mainmenu/ButtonSubScene.h
parent5a2f6a14803885b7c53bab7d43208476d2e1bd5b (diff)
added menu buttons + scene switching
Diffstat (limited to 'game/mainmenu/ButtonSubScene.h')
-rw-r--r--game/mainmenu/ButtonSubScene.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/game/mainmenu/ButtonSubScene.h b/game/mainmenu/ButtonSubScene.h
index fab076d..658e651 100644
--- a/game/mainmenu/ButtonSubScene.h
+++ b/game/mainmenu/ButtonSubScene.h
@@ -1,6 +1,7 @@
#pragma once
#include <crepe/api/GameObject.h>
+#include "MainMenuConfig.h"
namespace crepe {
class Scene;
@@ -8,7 +9,28 @@ class Scene;
class ButtonSubScene {
public:
- void create(crepe::Scene & scn);
+ //script enum
+ enum class ScriptSelect {
+ START,
+ PREVIEW,
+ SHOP,
+ NONE,
+ };
+ //data struct
+ struct Data{
+ const std::string & text = "NODATA";
+ const crepe::vec2 & text_offset = {0,0};
+ const crepe::vec2 & text_size = {200,200};
+ const crepe::vec2 & position = {0,0};
+ const ScriptSelect script = ScriptSelect::NONE;
+ };
+public:
+ void create(crepe::Scene & scn,const Data & data);
private:
void large_btn_overlay(crepe::GameObject & button_object);
+ void btn_color_side(crepe::GameObject & button_object,const crepe::vec2 & offset);
+ void btn_text_middle(crepe::GameObject & button_object,const std::string & text,const crepe::vec2 & text_offset,const crepe::vec2 & text_size);
+ void set_script(crepe::GameObject & button_object,ScriptSelect script);
+private:
+ static constexpr crepe::vec2 SIDE_PANEL_OFFSET = {113,0};
};