diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-12-23 22:37:05 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-12-23 22:37:05 +0100 |
commit | 4cbd236de18446d192dd59d7c7bc4ebb78850e37 (patch) | |
tree | ea84c67e6ce8521dc151504c3e560ce0f6064f99 /game/mainmenu/ShopMenuScene.cpp | |
parent | 225e873c8ac9c4c08720a69b8f2c817d22cf0071 (diff) |
added shop scene with background
Diffstat (limited to 'game/mainmenu/ShopMenuScene.cpp')
-rw-r--r-- | game/mainmenu/ShopMenuScene.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/game/mainmenu/ShopMenuScene.cpp b/game/mainmenu/ShopMenuScene.cpp new file mode 100644 index 0000000..f3ca9ce --- /dev/null +++ b/game/mainmenu/ShopMenuScene.cpp @@ -0,0 +1,49 @@ + +#include "ShopMenuScene.h" +#include "api/Camera.h" +#include "MainMenuConfig.h" +#include "api/Sprite.h" + +using namespace crepe; +using namespace std; + +void ShopMenuScene::load_scene(){ + GameObject camera_object = this->new_object(MainMenuConfig::CAMERA_NAME); + camera_object.add_component<Camera>(ivec2(990, 720), vec2(1100, 800), + Camera::Data{ + .bg_color = Color::RED, + }); + + GameObject menu_background = this->new_object("menu_background"); + menu_background.add_component<Sprite>( + Asset("asset/ui/background.png"), + Sprite::Data{ + .sorting_in_layer = MainMenuConfig::STARTING_SORTING_IN_LAYER+0, + .size = {1100,860}, + .position_offset {0}, + }); + GameObject menu_banner = this->new_object("menu_banner","", {0,-414}); + menu_banner.add_component<Sprite>( + Asset("asset/ui/settings_container/top_middle_setting.png"), + Sprite::Data{ + .sorting_in_layer = MainMenuConfig::STARTING_SORTING_IN_LAYER+1, + .size = {1100,88}, + }); + menu_banner.add_component<Sprite>( + Asset("asset/ui/settings_container/top_2_middle_setting.png"), + Sprite::Data{ + .sorting_in_layer = MainMenuConfig::STARTING_SORTING_IN_LAYER+1, + .size = {1100,66}, + .position_offset {0,77}, + }); + menu_banner.add_component<Sprite>( + Asset("asset/ui/settings_container/banner_bottom.png"), + Sprite::Data{ + .sorting_in_layer = MainMenuConfig::STARTING_SORTING_IN_LAYER+1, + .size = {1100,7}, + .position_offset {0,113}, + }); + +} + +string ShopMenuScene::get_name() const { return "shopmenu"; } |