diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2025-01-06 17:49:39 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2025-01-06 17:49:39 +0100 |
commit | 07615060da6c211e08a3d7f2e1bb9e99ffc05364 (patch) | |
tree | e272fd896ac25aa7ac6d7b4c20dbe5c49a042dce /game/menus/ButtonSubScene.h | |
parent | ce655acf72c5d5be62497dbaac41af7ef49be411 (diff) |
moved and updated files
Diffstat (limited to 'game/menus/ButtonSubScene.h')
-rw-r--r-- | game/menus/ButtonSubScene.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/game/menus/ButtonSubScene.h b/game/menus/ButtonSubScene.h new file mode 100644 index 0000000..06006ac --- /dev/null +++ b/game/menus/ButtonSubScene.h @@ -0,0 +1,57 @@ +#pragma once + +#include <crepe/api/GameObject.h> +#include <string> + +namespace crepe { +class Scene; +} + +class ButtonSubScene { +public: + //script enum + enum class ScriptSelect { + PREVIEW, + SHOP, + MAINMENU, + NONE, + }; + //icon enum + enum class IconSelect { + SHOP, + COINS, + NONE, + }; + //icon enum + enum class ButtonSelect { + SMALL, + LARGE, + }; + //data struct + struct Data{ + const std::string & text = "NODATA"; + const crepe::vec2 & text_offset = {0,0}; + const float text_width = 200; + const crepe::vec2 & icon_offset = {0,0}; + const IconSelect icon_type = IconSelect::NONE; + const crepe::vec2 & position = {0,0}; + const ScriptSelect script_type = ScriptSelect::NONE; + const ButtonSelect button_type = ButtonSelect::LARGE; + const float scale = 1; + const bool worldspace = true; + const bool color_side = true; + const std::string & tag = ""; + }; +public: + void create(crepe::Scene & scn,const Data & data); +private: + void large_btn_overlay(crepe::GameObject & button_object,const Data & data); + void small_btn_overlay(crepe::GameObject & button_object,const Data & data); + void btn_color_side(crepe::GameObject & button_object,const crepe::vec2 & offset,const Data & data); + void btn_text(crepe::GameObject & button_object,const Data & data); + void set_script(crepe::GameObject & button_object,const Data & data); + void set_icon(crepe::GameObject & button_object,const Data & data); + void set_button_overlay(crepe::GameObject & button_object,const Data & data); +private: + static constexpr crepe::vec2 SIDE_PANEL_OFFSET = {113,0}; +}; |