diff options
author | Jaro <59013720+JaroWMR@users.noreply.github.com> | 2025-01-08 09:31:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-08 09:31:14 +0100 |
commit | e75ca1c947f3cde19bebf15049732bc069c6e913 (patch) | |
tree | cdaa7a2c06ffc7f41366d4106e16f254e3b9cdc5 /game/menus/shop/ShopMenuScene.cpp | |
parent | f31bd86ae5d7df21b788a273d4f2e530136ec184 (diff) | |
parent | 0d087f23affbdf5bcfb238bc9b9d3fc05b314c44 (diff) |
Merge pull request #101 from lonkaars/jaro/main-menu
Jaro/main menu
Diffstat (limited to 'game/menus/shop/ShopMenuScene.cpp')
-rw-r--r-- | game/menus/shop/ShopMenuScene.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/game/menus/shop/ShopMenuScene.cpp b/game/menus/shop/ShopMenuScene.cpp new file mode 100644 index 0000000..21e3f02 --- /dev/null +++ b/game/menus/shop/ShopMenuScene.cpp @@ -0,0 +1,55 @@ + +#include "ShopMenuScene.h" + +#include "../BannerSubScene.h" +#include "../ButtonSubScene.h" +#include "../MenusConfig.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; } |