Clone wiki

2D XNA Primitives / DrawCircle

DrawCircle

Draws a circle using one line segment per side.

The circle's comprising line segments are cached so that the circle does not need to be recalculated every frame.

public static void DrawCircle(this SpriteBatch spriteBatch, Vector2 center, float radius, int sides, Color color, float thickness = 1f)
public static void DrawCircle(this SpriteBatch spriteBatch, float x, float y, float radius, int sides, Color color, float thickness = 1f)
Parameter NameDescription
spriteBatchThe destination drawing surface
xThe x coordinate of the center of the circle
yThe y coordinate of the center of the circle
centerThe center of the circle
radiusThe radius of the circle
sidesThe number of sides to generate
colorThe color of the circle
thicknessThe thickness of the circle. Default = 1f

Updated