How to Draw a Circle in PICO-8
22 November, 2022
PICO-8 provides two simple ways to draw a circle: CIRC()
and CIRCFILL()
. CIRC()
will draw an empty circle with a 1 pixel-wide border and CIRCFILL()
will draw a filled circle. Each function takes an x coordinate, a y coordinate, a radius, and a color.
RED = 8
X=64
Y=32
R=4
C=RED
-- DRAWS A RED CIRCLE IN THE CENTER OF THE SCREEN
CIRC(X,Y,R,C)
-- DRAWS A FILLED, RED CIRCLE IN THE CENTER OF THE SCREEN
CIRCFILL(X,Y,R,C)
If you’re drawing a lot of shapes with the same color, you may omit the color parameter by setting the current color with the COLOR()
function.
RED=8
FUNCTION _DRAW()
X=64
Y=64
R=4
COLOR(RED)
CIRCFILL(X+4*0,Y,R)
CIRCFILL(X+4*1,Y,R)
CIRCFILL(X+4*2,Y,R)
CIRCFILL(X+4*3,Y,R)
CIRCFILL(X+4*4,Y,R)
CIRCFILL(X+4*5,Y,R)
CIRCFILL(X+4*6,Y,R)
CIRCFILL(X+4*7,Y,R)
CIRCFILL(X+4*8,Y,R)
CIRCFILL(X+4*9,Y,R)
END