The following stack notation apllies for this description of the Graphics word set:
stack type description
--------------------------------
x n x-coordinate
y n y-coordinate
w n distance measure in x direction (Width)
h n distance measure in y direction (Height)
Graphics Words ________________________________________________________________
Most of the words in the Graphics library is quite similar to those found in ARM
BBC BASIC.
ORIGIN
( x y -- )
Set the graphics origin to x,y.
PLOT Graphics
( x y w -- )
General plot command. w is plot type, x and y are the coordinates.
CLG Graphics
( -- )
Clear the current graphics window.
CLS Graphics
( -- )
Clear the current text window.
PAPER
( u -- )
Select text background colour u.
INK
( u -- )
Select text foreground colour u.
GPAPER
( u -- )
Select graphics background colour u.
GINK
( u -- )
Select graphics foreground colour u.
GACTION Graphics
( w -- )
Select plot action for subsequent graphic commands. See the Programmer's Reference Manual or the BASIC manual for an explanation of the action values.
COLOUR Graphics
( r g b u -- )
Set logical colour number u to the RGB values specified by r, g and b. r is red component, g is green and b is blue.
MOVETO Graphics
( x y -- )
Move graphics output cursor to x,y. The coordinates are absolute, ie. relative to the origin.
MOVEBY Graphics
( x y -- )
Move graphics output cursor to x,y. The coordinates are relative to the last point plotted to.
POINT Graphics
( x y -- )
Plot a point at x,y in the current graphics foreground colour. The coordinates are absolute.
POINTBY Graphics
( x y -- )
Plot a point at x,y in the current graphics foreground colour. The coordinates are relative to the last point plotted to.
DRAW Graphics
( x y -- )
Draw a line to x,y. The coordinates are absolute.
DRAWBY Graphics
( x y -- )
Draw a line to x,y. The coordinates are relative to the last point plotted to.
RECTANGLE
( x y w h -- )
Draw a rectangle at x,y with width w and height h. The output cursor is positioned at x,y at the end of the operation.
RECTANGLE
( x y w h -- )
Draw a filled rectangle at x,y with width w and height h. The output cursor is positioned at x,y at the end of the operation (different from BBC BASIC).
CIRCLE
( x y r -- )
Draw a circle with center at x,y and radius r.
CIRCLE-FILL
( x y r -- )
Draw a filled circle with center at x,y and radius r.
ELLIPSE
( x y w h -- )
Draw an ellipse with center at x,y, major axis w and minor axis h. The ellipse cannot be rotated in the current implementation.
ELLIPSE-FILL
( x y w h -- )
Draw a filled ellipse with center at x,y, major axis w and minor axis h.
MODE Graphics
( u -- )
Change to screen mode u. u is in the range 0-255.
Wait
( -- )
Wait until next vertical sync.
ON
( -- )
Turn on the cursor
OFF
( -- )
Turn off the cursor
BORDER
( r g b -- )
Set the border colour to the RGB components r, g and b.