GuiButton.hpp 765 B

1234567891011121314151617181920212223242526272829
  1. #include "GuiTriangle.hpp"
  2. /**
  3. * @class GuiButton
  4. * @author POSITIVE MENTAL ATTITUDE
  5. * @date 06/09/16
  6. * @file Triangle.hpp
  7. * @brief Not too much swag in this class tbh.
  8. */
  9. class GuiButton: public GuiTriangle
  10. {
  11. public:
  12. GuiButton(): GuiTriangle(), _flip(false) {rotate(97.5f); _value = nullptr;}
  13. void create(const sf::Font& font, std::string caption, bool* value);
  14. void recreate();
  15. void click(sf::Vector2i mouseXY);
  16. void flip(bool val);
  17. void setPosition(sf::Vector2f position);
  18. void setPosition(float x, float y);
  19. void setCharacterSize(unsigned size);
  20. void setColor(sf::Color color);
  21. private:
  22. void draw(sf::RenderTarget& target, sf::RenderStates states) const;
  23. std::string _string;
  24. sf::Text _caption;
  25. bool* _value;
  26. bool _flip;
  27. };