29 #ifndef THOR_ARROW_HPP
30 #define THOR_ARROW_HPP
34 #include <SFML/Graphics/Drawable.hpp>
35 #include <SFML/Graphics/Transformable.hpp>
36 #include <SFML/Graphics/ConvexShape.hpp>
48 class THOR_API
Arrow :
public sf::Drawable,
public sf::Transformable
68 static void setZeroVectorTolerance(
float tolerance);
72 static float getZeroVectorTolerance();
83 explicit Arrow(sf::Vector2f position = sf::Vector2f(), sf::Vector2f direction = sf::Vector2f(),
84 const sf::Color& color = sf::Color::White,
float thickness = 3.f);
88 void setDirection(sf::Vector2f direction);
92 void setDirection(
float dirX,
float dirY);
96 sf::Vector2f getDirection()
const;
100 void setThickness(
float thickness);
104 float getThickness()
const;
108 void setColor(
const sf::Color& color);
112 sf::Color getColor()
const;
116 void setStyle(Style style);
120 Style getStyle()
const;
126 float getTriangleHeight()
const;
127 void adaptLine()
const;
128 void adaptTriangle()
const;
129 void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
137 sf::Vector2f mDirection;
141 mutable bool mNeedsShapeUpdate;
142 mutable sf::ConvexShape mLine;
143 mutable sf::ConvexShape mTriangle;
145 static float zeroVectorTolerance;
153 #endif // THOR_ARROW_HPP
void setColor(T &object, const sf::Color &color)
Sets the color of a graphical object.
Straight line without any triangles.
Definition: Arrow.hpp:57
Definition: Animator.hpp:42
Drawable arrow class.
Definition: Arrow.hpp:48
Configuration header of the library.
Style
Determines whether the arrow has a triangle on his endpoint.
Definition: Arrow.hpp:55
Normal unidirectional arrow.
Definition: Arrow.hpp:58