1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#pragma once #include "Widget.hpp" #include <string> #include <functional> namespace gsr { class Button : public Widget { public: Button(mgl::vec2f size); void on_event(mgl::Event &event, mgl::Window &window) override; void draw(mgl::Window &window) override; std::function<void()> on_click; private: mgl::vec2f size; bool mouse_inside = false; }; }