The DRAW statement combines most of the capabilities of the other graphics statements into an object definition language called Graphics Macro Language (GML). A GML command is a single character within a string, optionally followed by one or more arguments.
The DRAW statement is valid only in graphics mode.
Each of the following movement commands begins movement from the current graphics position. This is usually the coordinate of the last graphics point plotted with another GML command, LINE, or PSET. The current position defaults to the center of the screen (160,100 in medium resolution; 320,100 in high resolution) when a program is run. Movement commands move for a distance of scale factor *n, where the default for nis 1; thus, they move one point if n is omitted and the default scale factor is used.
diagonally up and right
diagonally down and right
diagonally down and left
diagonally up and left
This command moves as specified by the following argument:
Move absolute or relative. If x is preceded by a + or -, x and y are added to the current graphics position, and connected to the current position by a line. Otherwise, a line is drawn to point x, y from the current position.
The following prefix commands may precede any of the above movement commands:
Move, but plot no points.
Move, but return to original position when done.
The following commands are also available:
Set angle n. nmay range from 0 to 3, where 0 is 0°, 1 is 90°, 2 is 180°, and 3 is 270°. Figures rotated 90° or 270° are scaled so that they will appear the same size as with 0° or 180° on a monitor screen with the standard aspect ratio of 4:3.
Turn angle n. ncan be any value from negative 360 to positive 360. If the value specified by nis positive, it turns the angle counter-clockwise. If the value specified by nis negative, it turns clockwise.
Set color n. See the COLOR, PALETTE, and SCREEN statements for discussions of valid colors, numbers and attributes.
Set scale factor. nmay range from 1 to 255. nis divided by 4 to derive the scale factor. The scale factor is multiplied by the distances given with U, D, L, R, E, F, G, H, or relative M commands to get the actual distance traveled. The default for S is 4.
Execute substring. This command executes a second substring from a string, much like GOSUB. One string executes another, which executes a third, and so on.
stringis a variable assigned to a string of movement commands.
Specifies the colors for a graphics figure and creates a filled-in figure.
paintspecifies what color you want the figure filled in with.
boundaryspecifies the border color (outline).
See the COLOR, PALETTE, and SCREEN statements for discussions of valid colors, numbers and attributes.
You must specify values for both paint and boundarywhen used.
This command (Ppaint,boundary) does not paint color tiling.
Numeric arguments can be constants like "123" or "=variable;", where variableis the name of a variable.
When you use the second syntax, "=variable;", the semicolon must be used. Otherwise, the semicolon is optional between commands.
You can also specify variables using VARPTR$(variable).
To draw a box in medium resolution:
10 SCREEN 1
30 DRAW "U=A; R=A; D=A; L=A;"
The aspect ratio to draw a square on a standard screen is 4:3, as shown below:
To draw a 96 pixel-wide square on a 640 × 200 pixel screen (SCREEN 2), do the following calculations:
Horizontal value = 96
Vertical value = 96*(200/640)*(4/3)
Vertical value = 40
Horizontal value = 40*(640/200)*(3/4)
The horizontal values equals 4/3 of the vertical values.
All Frank Sinatra recordings, All Beatles albums, All solo albums from John Lennon, Paul McCartney, George Harrison and Ringo Starr, All Beatles songs, List of Platinum selling albums, Database with hits from 1950 to 1999.
Sought after DLL files, Nutworks magazine (retro), Worldwide ISO and TLD codes, File extensions database, The Hackers dictionary, Free software for the Atari, Amiga and Macintosh, Nokia smartphone, PocketPC, List of all BASIC programming language commands, List of all DOS commands, Free Advanced Bash-Scripting Guide (Linux-Unix)