home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / a293_1 / !AForth_Docs_Semantics_Graphics < prev    next >
Encoding:
Text File  |  1999-04-27  |  3.0 KB  |  156 lines

  1.  
  2. Semantics for The Graphics Word Set
  3.  
  4.  
  5.  
  6. The following stack notation apllies for this description of the Graphics word set:
  7.  
  8. stack   type    description
  9. --------------------------------
  10. x       n       x-coordinate
  11. y       n       y-coordinate
  12. w       n       distance measure in x direction (Width)
  13. h       n       distance measure in y direction (Height)
  14.  
  15.  
  16.  
  17. Graphics Words ________________________________________________________________
  18.  
  19. Most of the words in the Graphics library is quite similar to those found in ARM
  20. BBC BASIC.
  21.  
  22.  
  23. ORIGIN
  24. ( x y -- )
  25. Set the graphics origin to x,y.
  26.  
  27.  
  28. PLOT  Graphics
  29. ( x y w -- )
  30. General plot command. w is plot type, x and y are the coordinates.
  31.  
  32.  
  33. CLG  Graphics
  34. ( -- )
  35. Clear the current graphics window.
  36.  
  37.  
  38. CLS  Graphics
  39. ( -- )
  40. Clear the current text window.
  41.  
  42.  
  43. PAPER
  44. ( u -- )
  45. Select text background colour u.
  46.  
  47.  
  48. INK
  49. ( u -- )
  50. Select text foreground colour u.
  51.  
  52.  
  53. GPAPER
  54. ( u -- )
  55. Select graphics background colour u.
  56.  
  57.  
  58. GINK
  59. ( u -- )
  60. Select graphics foreground colour u.
  61.  
  62.  
  63. GACTION  Graphics
  64. ( w -- )
  65. Select plot action for subsequent graphic commands. See the Programmer's Reference Manual or the BASIC manual for an explanation of the action values.
  66.  
  67.  
  68. COLOUR  Graphics
  69. ( r g b u -- )
  70. 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.
  71.  
  72.  
  73. MOVETO  Graphics
  74. ( x y -- )
  75. Move graphics output cursor to x,y. The coordinates are absolute, ie. relative to the origin.
  76.  
  77.  
  78. MOVEBY  Graphics
  79. ( x y -- )
  80. Move graphics output cursor to x,y. The coordinates are relative to the last point plotted to.
  81.  
  82.  
  83. POINT  Graphics
  84. ( x y -- )
  85. Plot a point at x,y in the current graphics foreground colour. The coordinates are absolute.
  86.  
  87.  
  88. POINTBY  Graphics
  89. ( x y -- )
  90. Plot a point at x,y in the current graphics foreground colour. The coordinates are relative to the last point plotted to.
  91.  
  92.  
  93. DRAW  Graphics
  94. ( x y -- )
  95. Draw a line to x,y. The coordinates are absolute.
  96.  
  97.  
  98. DRAWBY  Graphics
  99. ( x y -- )
  100. Draw a line to x,y. The coordinates are relative to the last point plotted to.
  101.  
  102.  
  103. RECTANGLE
  104. ( x y w h -- )
  105. 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.
  106.  
  107.  
  108. RECTANGLE
  109. ( x y w h -- )
  110. 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).
  111.  
  112.  
  113. CIRCLE
  114. ( x y r -- )
  115. Draw a circle with center at x,y and radius r.
  116.  
  117.  
  118. CIRCLE-FILL
  119. ( x y r -- )
  120. Draw a filled circle with center at x,y and radius r.
  121.  
  122.  
  123. ELLIPSE
  124. ( x y w h -- )
  125. Draw an ellipse with center at x,y, major axis w and minor axis h. The ellipse cannot be rotated in the current implementation.
  126.  
  127.  
  128. ELLIPSE-FILL
  129. ( x y w h -- )
  130. Draw a filled ellipse with center at x,y, major axis w and minor axis h.
  131.  
  132.  
  133. MODE  Graphics
  134. ( u -- )
  135. Change to screen mode u. u is in the range 0-255.
  136.  
  137.  
  138. Wait
  139. ( -- )
  140. Wait until next vertical sync.
  141.  
  142.  
  143. ON
  144. ( -- )
  145. Turn on the cursor
  146.  
  147.  
  148. OFF
  149. ( -- )
  150. Turn off the cursor
  151.  
  152.  
  153. BORDER
  154. ( r g b -- )
  155. Set the border colour to the RGB components r, g and b.
  156.