HUNTER supports a graphics display of 240 x 64 pixels. Each point can be set to either white or black with the appropriate statement. Entering graphics mode is via the SCREEN statement, but this may be unnecessary since most of the functions which operate in graphics mode will automatically invoke the graphics screen.
The graphics statements in Basic are:-
SCREEN 1 enters graphics mode but also defaults the current character set to CHAR 0 and clears the display.
The origin of the graphics screen is the top left hand corner, with the co-ordinates (0,0). So
PSET(0,0) will set the corner pixel black. The origin for the LOCATE function, to determine the starting point for displaying ASCII characters, is (1,1) in the top left hand corner.
Co-ordinates when specified are always absolute, ranging 0-239 for X and 0-63 for Y. If two pairs of co-ordinates are required, then the first pair may be defaulted to the last plotted position.
The above functions can be made to draw characters or lines in either white on black or black on white. This is achieved by appending another parameter after the command. For example, to print inverse characters of medium size use;-
The '1' means inverse.
A detailed description of the above graphics commands can be found in Basic Functions.
Graphics mode on the HUNTER does not directly support the simple cursor manipulation codes, e.g: backspace, line feed, etc. The operating system generates the required cursor movements.
The following program will draw a number of circles across the screen and back again;
10 SCREEN 1 20 FOR K=1 TO 167 STEP 4 30 CIRCLE (K+30,32),30 40 NEXT K 50 CLS 60 FOR K=167 TO 1 STEP -4 70 CIRCLE (K+30,32),15 80 NEXT K 90 CLS 100 GOTO20
The LINE command may also be used for drawing boxes as well drawing lines. The command:
10 LINE (100,40)-(200,20)
will draw a line from the co-ordinates 100,40 to 200,20, the top left hand corner of the screen being 0,0. The following will draw a box with the bottom left hand comer at point 100,20 and the top right hand comer at 200,20:
10 LINE (100,40)-(200,20),1,B
If the second parameter is used then the first must also be specified. The box may be filled in by appending 'F' to the second parameter.
The Graphic's cursor can be positioned to any point on the screen by using the LOCATE command. Pixels are set by using PSET or cleared by PRESET. The following example will produce a dotted line across the screen:
10 SCREEN 1 20 FOR X=0 TO 239 STEP 4 30 PSET (X,30) 40 NEXT X 50 END