31#include <SFML/Graphics/Drawable.hpp>
32#include <SFML/System/Vector2.hpp>
193 static Shape Line(
float P1X,
float P1Y,
float P2X,
float P2Y,
float Thickness,
const Color& Col,
float Outline = 0.f,
const Color& OutlineCol =
sf::Color(0, 0, 0));
206 static Shape Line(
const Vector2f& P1,
const Vector2f& P2,
float Thickness,
const Color& Col,
float Outline = 0.f,
const Color& OutlineCol =
sf::Color(0, 0, 0));
262 virtual void Render(RenderTarget& Target)
const;
282 static bool ComputeNormal(
const Vector2f& P1,
const Vector2f& P2, Vector2f& Normal);
289 Point(
const Vector2f& Pos = Vector2f(0, 0),
const Color& C =
Color(255, 255, 255),
const Color& OutlineC =
Color(255, 255, 255));
300 std::vector<Point> myPoints;
302 bool myIsFillEnabled;
303 bool myIsOutlineEnabled;
Color is an utility class for manipulating 32-bits RGBA colors.
Abstract base class for every object that can be drawn into a render window.
static Shape Circle(float X, float Y, float Radius, const Color &Col, float Outline=0.f, const Color &OutlineCol=sf::Color(0, 0, 0))
Create a shape made of a single circle (use floats).
unsigned int GetNbPoints() const
Get the number of points composing the shape.
Shape()
Default constructor.
const Vector2f & GetPointPosition(unsigned int Index) const
Get the position of a point.
void EnableFill(bool Enable)
Enable or disable filling the shape.
float GetOutlineWidth() const
Get the width of the shape outline.
void SetOutlineWidth(float Width)
Change the width of the shape outline.
static Shape Line(float P1X, float P1Y, float P2X, float P2Y, float Thickness, const Color &Col, float Outline=0.f, const Color &OutlineCol=sf::Color(0, 0, 0))
Create a shape made of a single line (use floats).
static Shape Rectangle(float P1X, float P1Y, float P2X, float P2Y, const Color &Col, float Outline=0.f, const Color &OutlineCol=sf::Color(0, 0, 0))
Create a shape made of a single rectangle (use floats).
void AddPoint(float X, float Y, const Color &Col=Color(255, 255, 255), const Color &OutlineCol=Color(0, 0, 0))
Add a point to the shape.
void SetPointOutlineColor(unsigned int Index, const Color &OutlineCol)
Set the outline color of a point.
void SetPointColor(unsigned int Index, const Color &Col)
Set the color of a point.
const Color & GetPointColor(unsigned int Index) const
Get the color of a point.
virtual void Render(RenderTarget &Target) const
/see Drawable::Render
void SetPointPosition(unsigned int Index, const Vector2f &Position)
Set the position of a point.
void EnableOutline(bool Enable)
Enable or disable drawing the shape outline.
const Color & GetPointOutlineColor(unsigned int Index) const
Get the outline color of a point.