public class CircleShape extends Shape
points, pointsNeedUpdate| Constructor and Description |
|---|
CircleShape()
Constructs a new circle shape with a zero radius, approximated using 30 points.
|
CircleShape(float radius)
Constructs a new circle shape with the specified radius, approximated using 30 points.
|
CircleShape(float radius,
int points)
Constructs a new circle shape with the specified parameters.
|
| Modifier and Type | Method and Description |
|---|---|
Transform |
getInverseTransform()
Gets the inverse of the current transformation matrix.
|
Vector2f |
getOrigin()
Gets the origin of this object.
|
Vector2f |
getPosition()
Gets the position of this object.
|
float |
getRadius()
Gets the radius of this circle.
|
float |
getRotation()
Gets the rotation angle of this object.
|
Vector2f |
getScale()
Gets the scaling of this object.
|
Transform |
getTransform()
Gets the current transformation matrix.
|
void |
move(float x,
float y)
Moves this object.
|
void |
move(Vector2f v)
Moves the object.
|
protected long |
nativeCreate()
Deprecated.
|
protected void |
nativeDelete()
Deprecated.
|
protected void |
nativeSetExPtr()
Deprecated.
|
void |
rotate(float angle)
Rotates this object around its origin.
|
void |
scale(float x,
float y)
Scales the object, using its origin as the scaling center.
|
void |
scale(Vector2f factors)
Scales the object, using its origin as the scaling center.
|
void |
setOrigin(float x,
float y)
Sets the rotation, scaling and drawing origin of this object.
|
void |
setPointCount(int count)
Sets the amount of points the circle should be approximated with.
|
void |
setPosition(float x,
float y)
Sets the position of this object in the scene so that its origin will be exactly on it.
|
void |
setRadius(float radius)
Sets the radius of this circle.
|
void |
setScale(float x,
float y)
Sets the scaling of this object, using its origin as the scaling center.
|
draw, getFillColor, getGlobalBounds, getLocalBounds, getOutlineColor, getOutlineThickness, getPoint, getPointCount, getPoints, getTexture, getTextureRect, setFillColor, setOrigin, setOutlineColor, setOutlineThickness, setPosition, setRotation, setScale, setTexture, setTexture, setTextureRectfinalizepublic CircleShape()
public CircleShape(float radius)
radius - the circle's radius.public CircleShape(float radius,
int points)
radius - the circle's radius.points - the amount of points to approximate the circle with.setPointCount(int)@Deprecated protected long nativeCreate()
SFMLNativeObjectnativeCreate in class SFMLNativeObject@Deprecated protected void nativeSetExPtr()
SFMLNativeObjectnativeSetExPtr in class SFMLNativeObject@Deprecated protected void nativeDelete()
SFMLNativeObjectnativeDelete in class SFMLNativeObjectpublic void setRadius(float radius)
radius - the new radius of the circle shape.public float getRadius()
public void setPointCount(int count)
count - the amount of points used to approximate the circle.public final void setPosition(float x,
float y)
TransformablesetPosition in interface Transformablex - the new X coordinate.y - the new Y coordinate.public final void setScale(float x,
float y)
TransformablesetScale in interface Transformablex - the new X scaling factor.y - the new Y scaling factor.public final void setOrigin(float x,
float y)
TransformablesetOrigin in interface Transformablex - the new X coordinate of the origin.y - the new Y coordinate of the origin.public Vector2f getPosition()
TransformablegetPosition in interface Transformablepublic float getRotation()
TransformablegetRotation in interface Transformablepublic Vector2f getScale()
TransformablegetScale in interface Transformablepublic Vector2f getOrigin()
TransformablegetOrigin in interface Transformablepublic final void move(float x,
float y)
Transformablemove in interface Transformablex - the X offset added to the current position.y - the Y offset added to the current position.public final void move(Vector2f v)
Transformablemove in interface Transformablev - the offset vector added to the current position.public final void rotate(float angle)
Transformablerotate in interface Transformableangle - the rotation angle in degrees.public final void scale(float x,
float y)
Transformablescale in interface Transformablex - the X scaling factor.y - the Y scaling factor.public final void scale(Vector2f factors)
Transformablescale in interface Transformablefactors - the scaling factors.public Transform getTransform()
TransformablegetTransform in interface Transformablepublic Transform getInverseTransform()
TransformablegetInverseTransform in interface Transformable