User guide
3.8. THE GRAPHICS LIBRARY 95
3.8.3 The Graphics Functions
opengraphics(xsize, ysize) CIN:y, POS:y, NAT:y
This function opens the graphic s library. It allocates a canvas of 8-bit pixels of
specified size and creates a prefined colour map.
closegraphics() CIN:y, POS:y, NAT:y
This function closes the graphics library returning the canvas to freestore.
wrpixel(x, y, col) CIN:y, POS:y, NAT:y
This function places a pixel of given colour at position (x, y) on the canvas.
wrpixel33(x, y, col) CIN:y, POS:y, NAT:y
This function places a 3x3 square of pixels of given colour centred at positi on (x, y)
on the canvas.
plotch(ch) CIN:y, POS:y, NAT:y
This function places a 8x12 array of pixels of given colour plotcolour with its bot-
tom l e ft pixel at (plotx,ploty). If ch is ’*n’, plotx is set to 10 and ploty decremented
by 14, otherwise plotx is incremented by 9.
plotstr(str) CIN:y, POS:y, NAT:y
This function calls plotch for each character in the given string.
moveto(x, y) CIN:y, POS:y, NAT:y
This function sets plotx and ploty to x and y, respectively.
moveby(dx, dy) CIN:y, POS:y, NAT:y
This function increments plotx and ploty by dx and dy, respectively.
drawto(x, y) CIN:y, POS:y, NAT:y
This function draws a line of colour plotcolour from (plotx, ploty) t o (x, y).
drawby(dx, dy) CIN:y, POS:y, NAT:y
This function draws a line of colour plotcolour from (plotx, ploty) to (plotx+x,
ploty+dy).
drawrect(x0, y0, x1, y1) CIN:y, POS:y, NAT:y
This function draws the outline of the rectangle (x0, y0), (x1, y0), ((x1, y1), (x1, y0)
using plotcolour. plotx and ploty are set to x1 and y1, respectively.
drawrndrect(x0, y0, x1, y1, radius) CIN:y, POS:y, NAT:y
This function draws the outline of the rectangle (x0, y0), (x1, y0), ((x1, y1), (x1, y0)
with rounded corner s of given radius using plotcolour. If radius is l es s than or equal
to zero the corners are square, and if radius is greater than half the sh ort e r side length
it is reduced to this value. plotx and ploty are set to x1 and y1, respecti vely.