aboutsummaryrefslogtreecommitdiff
path: root/game/mainmenu/BannerSubScene.cpp
blob: 8de5711f83c35131677ac5d89d1ffb1b737ae6aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "BannerSubScene.h"
#include "MainMenuConfig.h"


#include <crepe/api/Sprite.h>
#include <crepe/api/Scene.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 = 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},
		});
	crepe::vec2 size = {data.banner_title_width,(data.banner_title_width/data.banner_title.size())*2};

	menu_banner.add_component<Text>(size,data.banner_title_offset + MainMenuConfig::FONTOFFSET, MainMenuConfig::FONT, Text::Data{
		.text_color = Color::WHITE,
		}, data.banner_title);
}