circle()
Purpose
Draw a circle
Description
Draws a filled or outline circle with the given radius at the specified x and y coordinates and in the specified colour.
Syntax
circle( x, y, radius, vertices, colour, outline )
Arguments
x horizontal screen position in pixels
y vertical screen position in pixels
radius radius in pixels
vertices number of vertices in the circle (higher will be smoother)
colour colour name or RGB values { red, green, blue, opacity } between 0 and 1
outline If true then only the outline is drawn otherwise the shape is filled.
Example
clear()
for i = 1 to 100 loop
// Pick random colour
col = { random( 101 ) / 100, random( 101 ) / 100, random( 101 ) / 100, random( 101 ) / 100 }
x = random( gWidth() )
y = random( gHeight() )
radius = random( gWidth() / 4 )
vertices = 32
outline = random( 2 )
circle( x, y, radius, vertices, col, outline )
update()
repeat
// Wait 10 seconds
sleep( 10 )
Associated Commands