|
sf-svg
|
2D line More...
#include <Base.hpp>

Public Member Functions | |
| Line2 () | |
| Default constructor. More... | |
| Line2 (const sf::Vector2< T > point, const sf::Vector2< T > vector, const sf::Color color=sf::Color::White) | |
| Specialized constructor. More... | |
| T | length () |
| Calculate length. More... | |
Public Attributes | |
| sf::Vector2< T > | point |
| Beginning of the line. | |
| sf::Vector2< T > | vector |
| Vector (offset) More... | |
| sf::Color | color |
| Color of the line. | |
2D line
was written to be used in sf-svg back-end, but actually can be used in any project that uses SFML. Line is defined as a pair of point and a vector (offset). Because of this, such code:
Will draw a line between [50, 50] and [110, 50].
|
inline |
Default constructor.
Sets variables to proper values (white line between [0, 0] and [0, 0]).
|
inline |
Specialized constructor.
| [in] | point | – beginning |
| [in] | vector | – offset |
| [in] | color | – color of the line, white by default |
Creates line using given parameters.
|
inline |
Calculate length.
| sf::Vector2<T> sfc::Line2< T >::vector |
Vector (offset)
End of the line is point + vector.
1.8.13