BB___CIRCLE

=CIRCLE= toc

Description
> For use with graphics windows and graphicboxes, CIRCLE draws the outline of a circle shape with a radius r at the current pen position.

> There are five graphics commands that draw shapes: >> box >> circle >> ellipse >> line >> pie

Syntax
> //This command is NOT case sensitive.//

Using literal values

 * 1)  - a graphics window
 * 2)  - a graphicbox

Using variable values
> is the radius of the circle.

Hints
boxfilled circlefilled ellipsefilled piefilled
 * //**Color & Size.**// Shapes are drawn with a pen color set by the command and a line thickness set by the  command.
 * //**Filled Shapes.**// You cannot draw a shape and then it with color. (The  command is used to fill the graphics window with color). Instead, to make a shape filled with color, use the complimentary //shape//filled commands:

Example
An example of the command using a graphics window. code format="lb" nomainwin

WindowWidth=400 WindowHeight=300

open "Draw Circle Demo" for graphics_nsb_nf as #g #g "trapclose [quit]" 'put the pen down #g "down" 'place pen at the center of the circle #g "place 100 150" 'draw a circle with a radius of 63 pixels #g "circle 63"

wait

[quit] close #g end code

An example of the command using a graphicbox. code format="lb" nomainwin

WindowWidth=400 WindowHeight=300

graphicbox #g.gb 2, 2, 390, 270 open "Draw Circle Demo" for graphics_nsb_nf as #g #g "trapclose [quit]" 'put the pen down #g.gb "down" 'set pen color and size for shape #g.gb "color blue; size 3" 'set a point at the center of the circle #g.gb "set 100 150" 'draw a circle with a radius of 63 pixels #g.gb "circle 63"

wait

[quit] close #g end code

An example combining four shape commands in a graphics window. code format="lb" nomainwin

WindowWidth=400 WindowHeight=300

open "All Shapes Demo" for graphics_nsb_nf as #g #g "trapclose [quit]"

'put the pen down #g "down" 'set the pen color and size #g "color blue; size 2" 'place and draw a box #g "place 10 10; box 150 150" 'place and draw a circle #g "place 80 80; circle 40" 'place and draw an ellipse #g "place 200 200; ellipse 100 50" 'change pen color and size #g "color red; size 1" 'draw a line #g "line 10 10 200 200" #g "flush" 'make graphics stick wait

[quit] close #g end code

Useful Functions
code format="lb" Place a useful function using this keyword here code