#include "MainMenu.h" #include #include #include #include #include #include #include #include #include #include "TestLevel.h" MainMenu::MainMenu(const lwe::Str_8& id) : Level(id) { } void MainMenu::SetupResources() { Level::SetupResources(); } void MainMenu::Setup() { Level::Setup(); AddSystem(new lwe::CameraSystem()); AddSystem(new lwe::RigidBodySystem()); AddSystem(new lwe::GuiSystem()); lwe::Entity* cam = new lwe::Entity("Camera"); lwe::Camera* com = new lwe::Camera("Main"); cam->AddComponent(com); AddEntity(cam); } void MainMenu::PostInitialize(lwe::GpuCmdBuffer* cmdBuffer) { Level::PostInitialize(cmdBuffer); } void MainMenu::OnUpdate(lwe::RenderWindow* win, lwe::Input* input, const float delta) { Level::OnUpdate(win, input, delta); lwe::Vec2_f client = win->GetScale(); lwe::Entity* sp = GetEntity("SinglePlayer"); if (sp) sp->SetPos({client.x * 0.5f - sp->GetScale().x * 0.5f, sp->GetPos().y, 0.0f}); lwe::Entity* mp = GetEntity("MultiPlayer"); if (mp) mp->SetPos({client.x * 0.5f - mp->GetScale().x * 0.5f, mp->GetPos().y, 0.0f}); }