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/BannerSubScene.cpp | |
parent | f31bd86ae5d7df21b788a273d4f2e530136ec184 (diff) | |
parent | 0d087f23affbdf5bcfb238bc9b9d3fc05b314c44 (diff) |
Merge pull request #101 from lonkaars/jaro/main-menu
Jaro/main menu
Diffstat (limited to 'game/menus/BannerSubScene.cpp')
-rw-r--r-- | game/menus/BannerSubScene.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/game/menus/BannerSubScene.cpp b/game/menus/BannerSubScene.cpp new file mode 100644 index 0000000..006a829 --- /dev/null +++ b/game/menus/BannerSubScene.cpp @@ -0,0 +1,49 @@ +#include "BannerSubScene.h" +#include "MenusConfig.h" + +#include "../Config.h" + +#include <crepe/api/Scene.h> +#include <crepe/api/Sprite.h> +#include <crepe/api/Text.h> + +using namespace crepe; +using namespace std; + +void BannerSubScene::create(Scene & scn, const Data & data) { + GameObject menu_banner = scn.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 = 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 = 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 = STARTING_SORTING_IN_LAYER + 1, + .size = {1100, 7}, + .position_offset {0, 113}, + } + ); + crepe::vec2 size + = {data.banner_title_width, (data.banner_title_width / data.banner_title.size()) * 2}; + + menu_banner.add_component<Text>( + size, FONT, + Text::Data { + .world_space = true, + .text_color = Color::WHITE, + }, + data.banner_title_offset + FONTOFFSET, data.banner_title + ); +} |