From 453eac7f1f5ef70390ec51087fc1f190811a7507 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 17 Nov 2021 09:47:45 +0100 Subject: Replace sfml with mgl --- include/gui/Button.hpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'include/gui') diff --git a/include/gui/Button.hpp b/include/gui/Button.hpp index ba6997b..2a22a88 100644 --- a/include/gui/Button.hpp +++ b/include/gui/Button.hpp @@ -2,12 +2,12 @@ #include "../RoundedRectangle.hpp" #include -#include +#include -namespace sf { +namespace mgl { class Event; class Font; - class RenderTarget; + class Window; class Shader; } @@ -19,21 +19,21 @@ namespace QuickMedia { class Button { public: - Button(const std::string &label, sf::Font *font, unsigned int character_size, float width, sf::Shader *rounded_rectangle_shader, float scale = 1.0f); + Button(const std::string &label, mgl::Font *font, float width, mgl::Shader *rounded_rectangle_shader, float scale = 1.0f); - ButtonEvent on_event(sf::Event &event); - void draw(sf::RenderTarget &target); + ButtonEvent on_event(mgl::Event &event); + void draw(mgl::Window &target); - void set_background_color(sf::Color color); - void set_position(sf::Vector2f pos); + void set_background_color(mgl::Color color); + void set_position(mgl::vec2f pos); - sf::Vector2f get_position() const; + mgl::vec2f get_position() const; float get_width() const; - float get_height() const; + float get_height(); private: - sf::Text label; + mgl::Text label; RoundedRectangle background; - sf::Color background_color; + mgl::Color background_color; float scale; bool clicked_inside = false; }; -- cgit v1.2.3