#ifndef __PTF_UTIL_WIDGET_BUTTON_HPP__ #define __PTF_UTIL_WIDGET_BUTTON_HPP__ #include #include #include "manager.hpp" /** * Affiche un bouton pouvant être cliqué */ class WidgetButton { private: Manager& manager; std::function click_cb; unsigned int shape; sf::RectangleShape button; sf::VertexArray button_shape; public: static const unsigned int ARROW_UP; static const unsigned int ARROW_DOWN; WidgetButton( Manager& manager, std::function click_cb, sf::Vector2f size, unsigned int shape ); /** * Process l'événement et renvoie true si * on s'en est servi */ bool processEvent(const sf::Event& event); /** * Dessine le widget à la position (haut-gauche) donnée */ void draw(sf::Vector2f position); }; #endif