SmallBASIC GuideThe language | Programming Tips | Commands | System | Graphics & Sound | Miscellaneous | File system | Mathematics | 2D Algebra | Strings | Console | Glossary |
Graphics Commands

Command: ARC [STEP] x,y,r,astart,aend [,aspect [,color]] [COLOR color] Draws an arc. astart,aend = first,last angle in radians. LINECHART|BARCHART, array() [, type [, x1, y1, x2, y2]] Draws a chart of array values in the rectangular area x1,y1,x2,y2 Where 'type':
0 simple
1 with marks
2 with ruler
3 with marks & ruler

Command: PLOT xmin, xmax USE f(x) Graph of f(x) Example:
PLOT 0, 2*PI USE SIN(x)

Command: CIRCLE [STEP] x,y,r [,aspect [, color]] [COLOR color] [FILLED] Draws a circle (or an ellipse if the aspect is specified).
Command: COLOR foreground-color [, background-color] Specifies the foreground and background colors
Command: DRAWPOLY array [,x-origin,y-origin [, scalef [, color]]] [COLOR color] [FILLED] Draws a polyline If the array does not uses points as element arrays, then even elements for x (starting from 0), odd elements for y
Command: DRAW string Draws an object according to instructions specified as a string. string - A string expression containing commands in the BASIC graphics definition language. Graphics Definition Language In the movement instructions below, n specifies a distance to move. The number of pixels moved is equal to n multiplied by the current scaling factor, which is set by the S command.
Un Move up.
Dn Move down.
Ln Move left.
Rn Move right.
En Move diagonally up and right.
Fn Move diagonally down and right.
Gn Move diagonally down and left.
Hn Move diagonally up and left.
Mx,y Move to coordinate x,y. If x is preceded by a + or -, the movement is relative to the last point referenced.
B A prefix command. Next movement command moves but doesn't plot.
N A prefix command. Next movement command moves, but returns immediately to previous point.
*, This command it is had not tested - please report any bug or incompatibility. ,|STEP x2,y2] [, color | COLOR color] Draws a line
Command: PSET [STEP] x,y [, color | COLOR color] Draw a pixel ,|STEP x2,y2] [, color | COLOR color] [FILLED] Draws a rectangular parallelogram
Function: TXTW (s)
Function: TEXTWIDTH (s) Returns the text width of string s in pixels
Function: TXTH (s)
Function: TEXTHEIGHT (s) Returns the text height of string s in pixels
Function: XPOS 0
Function: YPOS 0 Returns the current position of the cursor in "characters".
Function: POINT (x [, y]) Returns the color of the pixel at x,y if y does not specified x contains the info-code@* 0 = returns the current X graphics position@* 1 = returns the current Y graphics position@*
Command: PAINT [STEP] x, y [,color [,border]] Fills an enclosed area on the graphics screen with a specific color. if the border-color is specified then the PAINT will fill all the area which is specified by the border-color. (fill-until, color!=point(x,y) if the border-color is NOT specified then the PAINT will fill all the are with the same color as the pixel at x,y. (fill-while, color=point(x,y))
Command: VIEW [x1,y1,x2,y2 [,color [,border-color]]] Defines a viewport. The viewport defined by VIEW is disabled by a VIEW command with no parameters.
Command: WINDOW [x1,y1,x2,y2] Specifies "world" coordinates for the screen. The WINDOW command allows you to redefine the corners of the display screen as a pair of "world" coordinates. The world space defined by WINDOW is disabled by a WINDOW command with no parameters.
Function: RGB (r, g, b) The RGB functions returns the RGB color codes for the specified values The RGB() takes values 0..255 for each of the color. The return value is a negative 24bit value to by used by drawing functions.
Function: RGBF (r, g, b) The RGBF functions returns the RGB color codes for the specified values The RGBF() takes values 0..1 for each of the color. The return value is a negative 24bit value to by used by drawing functions.
Command: BEEP 0 Generates a beep sound
Command: PLAY string Play musical notes
Command: SOUND freq, dur_ms [, vol] [BG] Plays a sound
Command: NOSOUND 0 Stops background sound. Also, clears the sound queue.


[Prev] [Next]