Draws a circle with specified center, radius, and fill mode.
Takes x (center X position in pixels, integer), y (center Y position in pixels, integer), radius (circle radius in pixels, positive integer), segments (number of line segments for smoothness, higher=smoother, typical 16-64), fill (fill mode: 0=outline only, 1=filled solid).
Returns nothing.
2D Overlay
Parameters & Returns
Parameters
xInt
yInt
radiusInt
segmentsInt
fillInt
Returns
Void
Quick Summary
Draws a circle with specified center, radius, and fill mode.
Takes x (center X position in pixels, integer), y (center Y position in pixels, integer), radius (circle radius in pixels, positive integer), segments (number of line segments for smoothness, higher=smoother, typical 16-64), fill (fill mode: 0=outline only, 1=filled solid).
Returns nothing.
Technical Exegesis...
Draws a circle with specified center, radius, and fill mode. Takes x (center X position in pixels, integer), y (center Y position in pixels, integer), radius (circle radius in pixels, positive integer), segments (number of line segments for smoothness, higher=smoother, typical 16-64), fill (fill mode: 0=outline only, 1=filled solid). Returns nothing. Queues circle draw command to deferred rendering buffer, executed during b3dRenderWorld. Uses current color state from b2dSetColor and alpha from b2dSetAlpha.
Draws a circle with specified center, radius, and fill mode. Takes x (center X position in pixels, integer), y (center Y position in pixels, integer), radius (circle radius in pixels, positive integer), segments (number of line segments for smoothness, higher=smoother, typical 16-64), fill (fill mode: 0=outline only, 1=filled solid). Returns nothing. Queues circle draw command to deferred rendering buffer, executed during b3dRenderWorld. Uses current color state from b2dSetColor and alpha from b2dSetAlpha.
Circle rendering: outline mode (fill=0 draws perimeter only using line segments), filled mode (fill=1 draws solid circle using triangle fan), segment count affects smoothness (16=octagon-like, 32=smooth, 64=very smooth but slower), radius defines size (radius=50 creates 100-pixel diameter circle).
Use cases: (1) Draw UI elements (health indicators, buttons, icons), (2) Debug visualization (collision circles, range indicators), (3) Particle effects (explosions, projectiles), (4) Geometric shapes (design elements, backgrounds).
Performance: segment count impacts draw cost (16 segments ~0.01ms, 64 segments ~0.03ms), filled circles cost more than outlines (triangle fan vs line loop), batching with similar circles improves performance.
Common patterns: outlined circle = b2dSetColor(255,255,255): b2dDrawCircle(x,y,50,32,0); filled circle = b2dSetColor(255,0,0): b2dDrawCircle(x,y,30,24,1); transparent circle = b2dSetAlpha(0.5): b2dDrawCircle(x,y,40,32,1).
Validation: negative radius treated as 0 (no draw), segments clamped to minimum 3 (triangle is minimum polygon), position can be offscreen (clipped automatically).