Futurebasic/Language/Reference/circle

From Wikibooks, open books for an open world
< Futurebasic‎ | Language‎ | Reference
Jump to: navigation, search

CIRCLE[edit]

statement[edit]

✔ Appearance ✔ Standard ✔ Console

Syntax[edit]

CIRCLE [ FILL ] <i>x</i>, <i>y</i>, <i>radius</i> [ { TO  | PLOT} <i>startAngle</i>, <i>angleSize</i>]

Description[edit]

Draws a circle, an arc or a wedge in the current foreground color, pen pattern and pen size. If a circle or wedge is drawn using the FILL keyword, the circle or wedge will be filled with the current pen pattern. When used in combination with the RATIO statement, CIRCLE can be used to draw ellipses and elliptical arcs and wedges.

If the current RATIO is set to 0,0 (the default), then CIRCLE behaves as follows:

If only the x, y, and radius parameters are specified, then a complete circle is drawn, with its center at point (x, y) and having a radius of radius pixels. If the TO keyword is specified, then a wedge (two radii plus an arc) is drawn. The first radius is drawn in the orientation specified by startAngle, which is measured in units of "brads" (see below). Angles are measured counterclockwise starting from the "3-o'clock" position, which corresponds to zero brads. The angleSize parameter specifies the angular width of the wedge (also in brads); the wedge always extends counterclockwise from the startAngle position. Note that the width of the "wedge" may be greater than a half-circle, in which case the "wedge" looks more like a Pac-Man. If the PLOT keyword is specified, then an arc is drawn without any radii. The position and size of the arc are the same as when the TO keyword is specified. If both the PLOT keyword and the FILL keyword are specified, then the CIRCLE command does nothing. "Brads" are an angular unit in which a full circle corresponds to 256 brads. A brad is therefore slightly larger than a degree (to be exact, it's 360/256 of a degree). A half circle therefore equals 128 brads, and a right angle equals 64 brads.

Example[edit]

CD Example: CIRCLE.BAS

"FB Lite" behavior:

When you use the "FB Lite" runtime, CIRCLE always switches to the Graphics Window before drawing. You can't use CIRCLE to draw a circles and arcs in the Text Window, or on the printer; use the Toolbox procedures FRAMEOVAL, FRAMEARC or PAINTOVAL instead. Alternatively, you can activate the graphics window and select Print from the File menu.

Note[edit]

If you use values outside the range 0..255 for startAngle and/or angleSize, then values modulo 256 will be used.

See Also[edit]

RATIO; FILL; FRAMEOVAL> andFRAMEARC Toolbox procedures