#pragma once #include #include #include namespace UI { class UserInterface { private: std::vector> m_Rects; Ref m_Framebuffer; // Texture of the interface. std::string m_Name; public: const int Width = 1920; const int Height = 1080; UserInterface(const std::string& name); static Ref New(const std::string& name); void Draw(); void Update(Timestep ts); std::vector> GetRects() { return m_Rects; } void AddRect(Ref rect) { m_Rects.push_back(rect); } Ref GetRectByID(const std::string& id) { for (auto r : m_Rects) { if (r->GetID() == id) return r; } return nullptr; } std::vector> GetRectsByGroup(const std::string& group) { std::vector> rects = std::vector>(); for (auto r : m_Rects) { if(r->HasGroup(group)) rects.push_back(r); } return rects; } }; }