View on GitHub

DSFML

dsfml.graphics.circleshape



class CircleShape: dsfml.graphics.shape.Shape;
Specialized shape representing a circle.

This class inherits all the functions of Transformable (position, rotation, scale, bounds, ...) as well as the functions of Shape (outline, color, texture, ...).

Since the graphics card can't draw perfect circles, we have to fake them with multiple triangles connected to each other. The "points count" property of CircleShape defines how many of these triangles to use, and therefore defines the quality of the circle.

Authors:
Laurent Gomila, Jeremy DeHaan

See Also:


http:
//www.sfml-dev.org/documentation/2.0/classsf_1_1CircleShape.php#details

this(float radius = 0, uint pointCount = 30);
Params:
float radius Radius of the circle
uint pointCount Number of points composing the circle

@property uint pointCount(uint newPointCount);
The number of points of the circle

@property uint pointCount();
The number of points of the circle

@property float radius(float newRadius);
The radius of the circle

@property float radius();
The radius of the circle

const Vector2f getPoint(uint index);
Get a point of the shape.

The result is undefined if index is out of the valid range.

Params:
uint index Index of the point to get, in range [0 .. pointCount - 1].

Returns:
Index-th point of the shape.

const @property CircleShape dup();
Clones this CircleShape