#pragma once #include "Triangle.hpp" /** * @class GuiTriangle * @author POSITIVE MENTAL ATTITUDE * @date 05/05/16 * @file Triangle.hpp * @brief All these (not so) fancy main menu triangles are GUI triangles. */ class GuiTriangle: public Triangle { public: GuiTriangle(); /** * @brief Returns the width of the triangle when it stands on its arm (rotated by 92.5°) */ float getWidth(); /** * @brief Checks if the cursor is inside of the triangle * @return boolean */ bool mouseIntersection(sf::Vector2i mouseXY); void click(sf::Vector2i mouseXY); void update(sf::Vector2i mouseXY, sf::Time delta); void bind(const std::function& lambda); protected: virtual void redraw(); private: float _scale; std::function onClick; };