GFX2: CoCo3 Graphics Subroutine Module arc Draw an arc. RUN GFX2 ( [path,] "ARC" [,mx, my], xrad, yrad, xcor1, ycor1, xcor2, ycor2) Parameters path Route to the window you want to use. mx, my X & Y coordinates for the center of the arc. xrad Radius of the arcs width. yrad Radius of the arcs height. xcor1, ycor1 Beginning and ending coordinates for an imaginary xcor2, ycor2 line relative to the center of the arc (0, 0) that GFX2 uses for drawing the arc. Drawing starts at the point of the arc closest to xcor1, ycor1. bar Draws a filled in rectangle. RUN GFX2 ( [path,] "BAR" [,xcor1, ycor1], xcor2, ycor2) Parameters path Route to the window to draw in. xcor1, ycor1 Beginning coordinates of the rectangle. xcor2, ycor2 Ending coordinates of the rectangle. bell Produce a beep through the terminal's speaker. RUN GFX2 ("BELL") Parameters None blnkoff Turn off blinking for characters being sent to a text window. RUN GFX2 ( [path,] "BLNKOFF") Parameters path Route to the window you want to use. blnkon Turn on blinking for characters being sent to a text window. RUN GFX2 ( [path,] "BLNKON") Parameters path Route to the window you want to use. Notes Does not work on a graphics window. boldsw Turn bold printing on or off for characters being printed. RUN GFX2 ( [path,] "BOLDSW", "switch") Parameters path Route to the window you want to use. switch "ON" to turn bold on. "OFF" to turn bold off. Notes Only works on a graphics window. border Set the border color palette. RUN GFX2 ( [path,] "BORDER", color) Parameters path Route to the window you want to use. color Palette number to use. box Draw a rectangle on a graphics window. RUN GFX2 ( [path,] "BOX" [,xcor1, ycor1], xcor2, ycor2) Parameters path Route to the window you want to use. xcor1, ycor1 Beginning coordinates for the box. xcor2, ycor2 Ending coordinates for the box. circle Draw a circle on a graphics window. RUN GFX2 ( [path,] "CIRCLE" [,xcor, ycor], radius) Parameters path Route to the window you want to use. xcor, ycor Coordinates to use as the center point. radius Radius of the circle. clear Clear the screen. RUN GFX2 ( [path,] "CLEAR") Parameters path Route to the window you want to use. color Set the window colors. RUN GFX2 ( [path,] "COLOR", foreground [,background] [,border] ) Parameters path Route to the window you want to use. foreground Register number to use for the foreground color. background Register number to use for the background color. border Register number to use for the border color. crrtn Sends a carriage return to the window. RUN GFX2 ( [path,] "CRRTN") Parameters path Route to the window you want to use. curdwn Moves the cursor down one text line. RUN GFX2 ( [path,] "CURDWN") Parameters path Route to the window you want to use. curhome Move the text cursor to the top left corner of the window. RUN GFX2 ( [path,] "CURHOME") Parameters path Route to the window you want to use. curlft Move the text cursor one character to the left. RUN GFX2 ( [path,] "CURLFT") Parameters path Route to the window you want to use. curoff Make the cursor invisible. RUN GFX2 ( [path,] "CUROFF") Parameters path Route to the window you want to use. curon Makes the text cursor visible. RUN GFX2 ( [path,] "CURON") Parameters path Route to the window you want to use. currgt Moves the text cursor one character to the right. RUN GFX2 ( [path,] "CURRGT") Parameters path Route to the window you want to use. curup Move the text cursor up one line. RUN GFX2 ( [path,] "CURUP") Parameters path Route to the window you want to use. curxy Move the text cursor to X column and Y row. RUN GFX2 ( [path,] "CURXY", column, row) Parameters path Route to the window you want to use. column Horizontal position on the window. row Vertical position on the window. Notes column and row are limited to the text size of the current window. cwarea Changes/sets the working area on the window. RUN GFX2 ( [path,] "CWAREA", xcor, ycor, sizex, sizey) Parameters path Route to the window you want to use. xcor, ycor Upper left corner of the new working area, relative to the original window. Coordinates are based on character positions - not graphics locations. sizex Number of character positions wide for the new area. sizey Number of rows down for the new area. defbuff Define a buffer for get/put operations. RUN GFX2 ("DEFBUFF", group, buffer, size) Parameters group A reference number you select. Range 1-199. buffer A number you assign to this buffer. Range 1-255. size Size of this buffer. Range 1-8192 depending on how much memory is available in this group. defcol Set palette registers to the default values. RUN GFX2 ( [path,] "DEFCOL") Parameters path Route to the window you want to use. dellin Delete the line of text the cursor is on. RUN GFX2 ( [path,] "DELLIN") Parameters path Route to the window you want to use. draw Draw a polyline figure based on information in an option list. RUN GFX2 ( [path,] "DRAW", option list) Parameters path Route to the window you want to use. option list A string containing the draw options/instructions. Options: Nnum North (up) num units. Snum South (down) num units. Enum East (right) num units. Wnum West (left) num units. NEnum NorthEast (up & right) num units. NWnum NorthWest (up & left) num units. SEnum SouthEast (down & right) num units. SWnum SouthWest (down & left) num units. Aval Axis for north. 0=top 1=right 2=bottom 3=left Uxcor, ycor Draw a line to x & y coordinates relative to the current draw pointer position. Bxcor, ycor Blank move to x & y coordinates relative to the current draw pointer position. dwend Deallocates (ends) a device window. RUN GFX2 ( [path,] "DWEND") Parameters path Route to the window you want to end. dwprotsw Protect/unprotect a device window. RUN GFX2 ( [path,] "DWPROTSW", "switch") Parameters path Route to the window you want to use. switch "ON" to protect a window. "OFF" to unprotect. Notes Unprotected windowscan be covered by another window. dwset Define a device window. RUN GFX2 ( [path,] "DWSET", format, xcor, ycor, width, length, foreground, background, border) Parameters path Route to the window you want to define. format Code for the type of screen to use. xcor, ycor Coordinates for the upper left corner of the window. width Width of the window, in characters. length Length of the window, in rows. foreground, Palettes to use for foreground, background, and background, border colors. border ellipse Draws an ellipse. RUN GFX2 ( [path,] "ELLIPSE" [,xcor, ycor], xrad, yrad) Parameters path Route to the window you want to use. xcor, ycor Coordinates for the center of the ellipse. xrad, yrad Radii of the ellipse's length and height. ereoline Erase from the cursor to the end of the line. RUN GFX2 ( [path,] "EREOLINE") Parameters path Route to the window you want to use. ereowndw Erase from the line the cursor is on to the end of the window. RUN GFX2 ( [path,] "EREOWNDW") Parameters path Route to the window you want to use. erline Delete the line of text the cursor is on. RUN GFX2 ( [path,] "ERLINE") Parameters path Route to the window you want to use. fill Fill (paint) a window, or a portion of it. RUN GFX2 ( [path,] "FILL" [,xcor, ycor]) Parameters path Route to the window you want to use. xcor, ycor X & Y coordinates to start the fill at. Notes Paints with the current foreground color. Only fills the area that's the same color as the point where it starts. font Defines which buffer is to be used for graphic text characters. RUN GFX2 ( [path,] "FONT", group, buffer) Parameters path Route to the window to be tied to the selected buffer. group Group number that contains the selected buffer. buffer Buffer number to use. gcset Select which graphics cursor to use. RUN GFX2 ("GCSET", group, buffer) Parameters group Group number that has the buffer you want to use. buffer Buffer number of the cursor image to use. get Store a portion of the window in a GET/PUT buffer. RUN GFX2 ( [path,] "GET", group, buffer, xcor, ycor, xsize, ysize) Parameters path Route to the window you want to use. group Group number that has the buffer to use. buffer Buffer number to store the data in. xcor, ycor X & Y coordinates of the upper left corner to save. xsize Horizontal size of the area to save. ysize Vertical size of the area to save. gpload Load a GET/PUT buffer with image data. RUN GFX2 ("GPLOAD", group, buffer, format, xdim, ydim, size) Parameters group Group number to associate this buffer with. buffer Buffer number for the buffer you create. format Type code for the screen format. xdim, ydim X & Y dimensions of the stored block. size Size of the buffer in bytes. 1 to 8 Kbytes. inslin Insert a blank line at the cursor position. RUN GFX2 ( [path,] "INSLIN") Parameters path Route to the window you want to use. killbuff Deallocate a GET/PUT buffer. RUN GFX2 ("KILLBUFF", group, buffer) Parameters group Group number of the buffer to get rid of. 1 to 199. buffer Buffer number to deallocate. 1 to 255. line Draw a line. RUN GFX2 ( [path,] "LINE" [,xcor1, ycor1], xcor2, ycor2) Parameters path Route to the window you want to use. xcor1, ycor1 X & Y coordinates for the start of the line. xcor2, ycor2 X & Y coordinates for the end of the line. logic Sets the logic type to be used on drawing functions. RUN GFX2 ("LOGIC", "function") Parameters function "OFF" - no logic is used. "AND" - AND logic is used. "OR" - OR logic is used. "XOR" - XOR logic is used. owend Deallocate the specified overlay window. RUN GFX2 ([path,] "OWEND") Parameters path Route to the window you want to end. Notes The book doesn't give a specific example of this function. owset Create an overlay window. RUN GFX2 ( [path,] "OWSET", save switch, xpos, ypos, xsize, ysize, foreground, backgound) Parameters path Route to the window to be overlaid. save switch 0 = Don't save overlaid area. 1 = Save overlaid area. xpos, ypos X & Y character positions for upper left corner. xsize Width of overlay window in characters. ysize Depth of overlay window in rows. foreground, Palettes to use for overlay foreground & background. background palette Set the color of a palette register. RUN GFX2 ( [path,] "PALETTE", register, color) Parameters path Route to the window you want to use. register Palette register number to set. color Value to set in register. 0 to 63. pattern Select the pattern buffer to use. RUN GFX2 ( [path,] "PATTERN", group, buffer) Parameters path Route to the window to associate with the buffer. group Group number that contains the buffer. buffer Buffer number for the patterns. point Set a point to current foreground color. RUN GFX2 ( [path,] "POINT" [,xcor, ycor]) Parameters path Route to the window you want to use. xcor, ycor X & Y coordinates of location to set. propsw Set/reset the proportional text switch. RUN GFX2 ( [path,] "PROPSW", "switch") Parameters path Route to the window you want to use. switch "ON" = proportional spacing. "OFF" = fixed spacing. putgc Place the graphics cursor anywhere on the screen. RUN GFX2 ( [path,] "PUTGC", xcor, ycor) Parameters path Route to the screen you want to use. xcor, ycor Screen X & Y coordinates for the cursor location. put Place a specified GET/PUT buffer on a window. RUN GFX2 ( [path,] "PUT", group, buffer, xcor, ycor) Parameters path Route to the window you want to use. group Group number containing the buffer you want to use. buffer Buffer number to put on the window. xcor, ycor X & Y coordinates of the upper left corner. revoff Turns reverse video off for characters. RUN GFX2 ( [path,] "REVOFF") Parameters path Route to the window you want to use. revon Turns reverse video on for characters. RUN GFX2 ( [path,] "REVON") Parameters path Route to the window you want to use. scalesw Turns scaling ON or OFF for graphics windows. RUN GFX2 ( [path,] "SCALESW", "switch") Parameters path Route to the window you want to use. switch "ON" = coordinates act as if the window was 640 x 192. "OFF" = coordinates are relative to the window origin. Notes Scaling does not affect text. select Select (change) which window is active for input/output. RUN GFX2 ( [path,] "SELECT") Parameters path Route to the window you want to select. setdptr Position the drawing pointer. RUN GFX2 ( [path,] "SETDPTR", xcor, ycor) Parameters path Route to the window you want to use. xcor, ycor X & Y coordinates to move the draw pointer to. undlnoff Turns character underlining off. RUN GFX2 ( [path,] "UNDLNOFF") Parameters path Route to the window where you want underlining off. undlnon Turns character underlining on. RUN GFX2 ( [path,] "UNDLNON") Parameters path Route to the window where you want underlining on.