diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-07 14:33:07 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2025-01-07 14:33:07 +0100 |
commit | 5d798c30af7026099344a068e91e1684018b4386 (patch) | |
tree | 923b54a2745c338478246b8707c6ce8361822fc7 /game/menus/shop | |
parent | 6d69c8ef6b663bd6716b441cc7d01164c7e33dfc (diff) | |
parent | 42cbef630ccaf3e841459d364edade1a3c72a525 (diff) |
merge + more WIP
Diffstat (limited to 'game/menus/shop')
-rw-r--r-- | game/menus/shop/ShopMenuScene.cpp | 47 | ||||
-rw-r--r-- | game/menus/shop/ShopMenuScene.h | 12 |
2 files changed, 59 insertions, 0 deletions
diff --git a/game/menus/shop/ShopMenuScene.cpp b/game/menus/shop/ShopMenuScene.cpp new file mode 100644 index 0000000..5d1348f --- /dev/null +++ b/game/menus/shop/ShopMenuScene.cpp @@ -0,0 +1,47 @@ + +#include "ShopMenuScene.h" + +#include "../ButtonSubScene.h" +#include "../MenusConfig.h" +#include "../BannerSubScene.h" +#include "../../Config.h" + +#include <crepe/api/Camera.h> +#include <crepe/api/Sprite.h> + +using namespace crepe; +using namespace std; + +void ShopMenuScene::load_scene(){ + GameObject camera_object = this->new_object(CAMERA_NAME); + camera_object.add_component<Camera>(ivec2(990, 720), vec2(1100, 800), + Camera::Data{ + .bg_color = Color::RED, + }); + BannerSubScene banner; + banner.create(*this,{ + .banner_title = "SHOP", + .banner_title_width = 200, + .banner_title_offset = {0,65}, + }); + GameObject menu_background = this->new_object("menu_background"); + menu_background.add_component<Sprite>( + Asset("asset/ui/background.png"), + Sprite::Data{ + .sorting_in_layer = STARTING_SORTING_IN_LAYER+0, + .size = {1100,860}, + .position_offset {0}, + }); + + ButtonSubScene button; + button.create(*this,ButtonSubScene::Data{ + .text = "BACK", + .text_width = 115, + .position = {-400,-350}, + .script_type = ButtonSubScene::ScriptSelect::MAINMENU, + .button_type = ButtonSubScene::ButtonSelect::BACK, + .scale = 0.8 + }); +} + +string ShopMenuScene::get_name() const { return SHOP_SCENE; } diff --git a/game/menus/shop/ShopMenuScene.h b/game/menus/shop/ShopMenuScene.h new file mode 100644 index 0000000..34c05ff --- /dev/null +++ b/game/menus/shop/ShopMenuScene.h @@ -0,0 +1,12 @@ +#pragma once + +#include <string> + +#include <crepe/api/Scene.h> + +class ShopMenuScene : public crepe::Scene { +public: + void load_scene(); + + std::string get_name() const; +}; |