#include "MainMenu.h" #include #include #include #include #include #include #include #include #include #include "TestLevel.h" MainMenu::MainMenu(const ehs::Str_8& id) : Level(id) { } void MainMenu::SetupResources(lwe::GpuInterface* inf) { Level::SetupResources(inf); } void MainMenu::Setup(lwe::GpuInterface* inf) { Level::Setup(inf); AddSystem(new lwe::CameraSystem()); AddSystem(new lwe::RigidBodySystem()); AddSystem(new lwe::GuiSystem()); lwe::Entity cam("Camera"); lwe::Camera* com = new lwe::Camera("Main"); cam.AddComponent(com); AddEntity((lwe::Entity&&)cam); } void MainMenu::PostInitialize(lwe::GpuCmdBuffer* cmdBuffer) { Level::PostInitialize(cmdBuffer); } void MainMenu::OnUpdate(lwe::RenderWindow* win, ehs::Input* input, const float delta) { Level::OnUpdate(win, input, delta); ehs::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}); }