b2dCreateCircle

Creates circle image (rasterized texture, returns handle for b2dDrawImage). Takes radius (circle radius in pixels, positive integer), segments (smoothness quality, higher=smoother, 3-128 range), fill (1=filled circle, 0=outline only). Returns image handle (positive integer, use with b2dDrawImage/b2dSetColor/b2dSetScale/b2dSetRotation, etc), returns 0 on failure.

2D Overlay

Parameters & Returns

Parameters

fill Int
radius Int
segments Int

Returns

Int

Quick Summary

Creates circle image (rasterized texture, returns handle for b2dDrawImage). Takes radius (circle radius in pixels, positive integer), segments (smoothness quality, higher=smoother, 3-128 range), fill (1=filled circle, 0=outline only). Returns image handle (positive integer, use with b2dDrawImage/b2dSetColor/b2dSetScale/b2dSetRotation, etc), returns 0 on failure.

Technical Exegesis...


Creates circle image (rasterized texture, returns handle for b2dDrawImage). Takes radius (circle radius in pixels, positive integer), segments (smoothness quality, higher=smoother, 3-128 range), fill (1=filled circle, 0=outline only). Returns image handle (positive integer, use with b2dDrawImage/b2dSetColor/b2dSetScale/b2dSetRotation, etc), returns 0 on failure.

Example

Example.bam

; Create a smooth filled green circle
circle = b2dCreateCircle(50, 32, 1)









; Draw it at screen position with color




b2dSetColor(0, 255, 0)




b2dDrawImage(circle, 400, 300)









; Can also scale and rotate




b2dSetScale(2.0, 2.0)




b2dSetRotation(45.0)




b2dDrawImage(circle, 600, 300)









; Free when done




b2dFreeImage(circle)