Shape

Base class for textured shapes with outline.

Members

Functions

draw
void draw(RenderTarget renderTarget, RenderStates renderStates)

Draw the shape to a render target.

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 = false)

Change the source texture of the shape.

update
void update()

Recompute the internal geometry of the shape.

Properties

fillColor
Color fillColor [@property setter]
Color fillColor [@property getter]

The fill color of the shape.

outlineColor
Color outlineColor [@property setter]
Color outlineColor [@property getter]

The outline color of the shape.

outlineThickness
float outlineThickness [@property setter]
float outlineThickness [@property getter]

The thickness of the shape's outline.

pointCount
uint pointCount [@property getter]

The total number of points in the shape.

textureRect
IntRect textureRect [@property setter]
IntRect textureRect [@property getter]

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

Inherited Members

From Drawable

draw
void draw(RenderTarget renderTarget, RenderStates renderStates)

Draw the object to a render target.

From Transformable

origin
Vector2f origin [@property setter]
Vector2f origin [@property getter]

The local origin of the object.

position
Vector2f position [@property setter]
Vector2f position [@property getter]

The position of the object. The default is (0, 0).

rotation
float rotation [@property setter]
float rotation [@property getter]

The orientation of the object, in degrees. The default is 0 degrees.

scale
Vector2f scale [@property setter]
Vector2f scale [@property getter]

The scale factors of the object. The default is (1, 1).

getTransform
const(Transform) getTransform()

Get the inverse of the combined transform of the object.

getInverseTransform
const(Transform) getInverseTransform()

Get the combined transform of the object.

move
void move(Vector2f offset)

Move the object by a given offset.

Meta