CircleShape

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.

Constructors

this
this(float radius, uint pointCount)

Destructor

~this
~this()
Undocumented in source.

Members

Functions

getPoint
Vector2f getPoint(uint index)

Get a point of the shape.

Properties

dup
CircleShape dup [@property getter]

Clones this CircleShape

pointCount
uint pointCount [@property setter]

The number of points of the circle

pointCount
uint pointCount [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
radius
float radius [@property setter]

The radius of the circle

radius
float radius [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From Shape

__anonymous
mixin NormalTransformable
Undocumented in source.
textureRect
IntRect textureRect [@property setter]

The sub-rectangle of the texture that the shape will display.

textureRect
IntRect textureRect [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
fillColor
Color fillColor [@property setter]

The fill color of the shape.

fillColor
Color fillColor [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
outlineColor
Color outlineColor [@property setter]

The outline color of the shape.

outlineColor
Color outlineColor [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
outlineThickness
float outlineThickness [@property setter]

The thickness of the shape's outline.

outlineThickness
float outlineThickness [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
pointCount
uint pointCount [@property getter]

Get the total number of points in the shape.

getGlobalBounds
FloatRect getGlobalBounds()

Get the global bounding rectangle of the entity.

getLocalBounds
FloatRect getLocalBounds()

Get the local bounding rectangle of the entity.

getPoint
Vector2f getPoint(uint index)

Get a point of the shape.

getTexture
const(Texture) getTexture()

Get the source texture of the shape.

setTexture
void setTexture(const(Texture) texture, bool resetRect)

Change the source texture of the shape.

draw
void draw(RenderTarget renderTarget, RenderStates renderStates)

Draw the shape to a render target.

update
void update()

Recompute the internal geometry of the shape.

See Also

Meta

Authors

Laurent Gomila, Jeremy DeHaan