diff options
Diffstat (limited to 'game/mainmenu/MainMenuScene.cpp')
-rw-r--r-- | game/mainmenu/MainMenuScene.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/game/mainmenu/MainMenuScene.cpp b/game/mainmenu/MainMenuScene.cpp index 4067681..7a86ba5 100644 --- a/game/mainmenu/MainMenuScene.cpp +++ b/game/mainmenu/MainMenuScene.cpp @@ -1,6 +1,8 @@ #include "MainMenuScene.h" #include "ButtonSubScene.h" +#include "ShowStartScript.h" +#include "api/BehaviorScript.h" #include "api/Camera.h" #include "../StartSubScene.h" #include "MainMenuConfig.h" @@ -18,27 +20,19 @@ void MainMenuScene::load_scene(){ .bg_color = Color::RED, }); - GameObject menu_background = this->new_object("menu_background","",MainMenuConfig::MENU_OFFSET + MainMenuConfig::MENU_OFFSET_BACKGROUND); - menu_background.add_component<Sprite>( + GameObject menu = this->new_object("menu_background","",MainMenuConfig::MENU_OFFSET + MainMenuConfig::MENU_OFFSET_BACKGROUND); + menu.add_component<Sprite>( Asset("asset/ui/itemsButtonBlankDark.png"), Sprite::Data{ .sorting_in_layer = MainMenuConfig::STARTING_SORTING_IN_LAYER+0, .size = {300,922}, }); + menu.add_component<BehaviorScript>().set_script<ShowStartScript>(); ButtonSubScene button; vec2 pos = MainMenuConfig::MENU_OFFSET; - //Start btn - button.create(*this,ButtonSubScene::Data{ - .text = "START", - .text_size = vec2{200,80}, - .position = pos, - .script = ButtonSubScene::ScriptSelect::START, - }); - //Preview btn - pos.y += MainMenuConfig::MENU_BUTTON_SPACING + MainMenuConfig::LARGE_OVERLAY_SIZE.y; button.create(*this,ButtonSubScene::Data{ .text = "PREVIEW", .text_size = vec2{200,80}, |