class main_menu {
public:
void initialization() {
t_main_menu_background.loadFromFile("external resources/artassets/menu/backgrounds/main_menu_background.jpg");
main_menu_background.setTexture(t_main_menu_background);
main_menu_background.setPosition(0, 0);
main_menu_background = system_global_environment.set_scale_of_sprite_based_on_window_size(main_menu_background);
menu_loading_screen.f_welcome_to_loading.loadFromFile("external resources/artassets/menu/sprites/loading_screen_text_eng.png");
f_main_logo.loadFromFile("external resources/artassets/menu/sprites/logo_with_icon_eng.png");
menu_loading_screen.t_welcome_to_loading.loadFromImage(menu_loading_screen.f_welcome_to_loading);
t_main_logo.loadFromImage(f_main_logo);
menu_loading_screen.welcome_to.setTexture(menu_loading_screen.t_welcome_to_loading);
menu_loading_screen.loading.setTexture(menu_loading_screen.t_welcome_to_loading);
main_logo.setTexture(t_main_logo);
menu_loading_screen.welcome_to.setTextureRect(IntRect(0, 0, 500, 125));
menu_loading_screen.loading.setTextureRect(IntRect(0, 125, 500, 250));
//menu_loading_screen.loading = system_global_environment.set_scale_of_sprite_based_on_window_size(menu_loading_screen.loading);
//menu_loading_screen.welcome_to = system_global_environment.set_scale_of_sprite_based_on_window_size(menu_loading_screen.welcome_to);
main_logo = system_global_environment.set_scale_of_sprite_based_on_window_size(main_logo);
menu_loading_screen.phase = 1;
menu_loading_screen.transparency = 0;
CurrentMenu = 1;
PreviousMenu = 0;
}
void draw_menu() {
switch (CurrentMenu) {
case 1:
switch (menu_loading_screen.phase) {
case 1:
menu_loading_screen.transparency = menu_loading_screen.transparency + 1;
break;
}
system_global_environment.get_p_window()->draw(main_menu_background);
system_global_environment.get_p_window()->draw(main_logo);
system_global_environment.get_p_window()->draw(menu_loading_screen.loading);
system_global_environment.get_p_window()->draw(menu_loading_screen.welcome_to);
break;
case 2:
break;
}
}
private:
int CurrentMenu,PreviousMenu;
Image f_main_logo;
Texture t_main_logo;
Texture t_main_menu_background;
Sprite main_menu_background;
Sprite main_logo;
struct loading_screen {
Image f_welcome_to_loading;
Texture t_welcome_to_loading;
Sprite welcome_to;
Sprite loading;
int phase;
int transparency;
} menu_loading_screen;
} system_main_menu;