home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / WGT_TC21.ZIP / WGT.DOC < prev    next >
Text File  |  1992-07-16  |  30KB  |  998 lines

  1.                 WordUp Graphics Toolkit
  2.                 Command Summary
  3.                 Turbo C Version
  4.  
  5.  
  6. All procedures are meant for use in the Large memory model.
  7.  
  8. Initialization:
  9. ~~~~~~~~~~~~~~~
  10.  
  11. vga256 procedure
  12. ------------------------------------------------------------------------------
  13. Function    Initializes the 256 color graphics mode.
  14.  
  15. Declaration    vga256()
  16.  
  17. Remarks        This command must be called before any other WGT commands
  18.         are called or they WILL NOT work.
  19.  
  20.  
  21.  
  22. Drawing Operations:
  23. ~~~~~~~~~~~~~~~~~~~
  24.  
  25. wcls procedure
  26. ------------------------------------------------------------------------------
  27. Function    Clears the currently selected graphics page with a specified
  28.         color number.
  29.  
  30. Declaration    wcls(int color)
  31.  
  32. Remarks        This command behaves like the BGI ClearDevice procedure except
  33.         that it allows you to use a certain "clearing" color and it
  34.         supports WGT's multiple graphics pages.
  35.  
  36. Restrictions    Clears entire page ignoring clipping.
  37.  
  38. See also    wsetscreen,wnormscreen
  39.  
  40.  
  41.  
  42.  
  43. wclip procedure
  44. ------------------------------------------------------------------------------
  45. Function    Sets the current clipping area for all graphics pages.
  46.  
  47. Declaration    wclip(int x1,int y1,int x2,int y2)
  48.  
  49. Remarks        (x1,y1) define the upper left corner of the clipping area,
  50.         and (x2,y2) define the lower right. Designated WGT drawing
  51.         commands will only draw within this boundary.
  52.         Set coordinates to (0,0,319,199) to disable clipping.
  53.  
  54. Restrictions    See EXTRA.DOC for information concerning which commands are
  55.         supported by this function.
  56.  
  57.  
  58.  
  59.  
  60. wgetpixel function
  61. -------------------------------------------------------------------------------
  62. Function    Gets the pixel value at X,Y. Uses current graphics page.
  63.  
  64. Declaration    wgetpixel(int x,int y);
  65.  
  66. Result Type    integer
  67.  
  68. See also    wputpixel
  69.  
  70.  
  71.  
  72.  
  73. wputpixel procedure
  74. -------------------------------------------------------------------------------
  75. Function    Plots a pixel at X,Y. Operates on current graphics page.
  76.  
  77. Declaration    wputpixel(int x,int y)
  78.  
  79. Remarks        Plots a point in the current drawing color (set by wsetcolor)
  80.         at (x,y).
  81.         
  82. See also    wgetpixel
  83.  
  84.  
  85.  
  86.  
  87. wline Procedure
  88. ------------------------------------------------------------------------------
  89. Function    Draws a line on the current graphics page from (x1,y1) to 
  90.         (x2,y2). Operates on current color and graphics page.
  91.  
  92. Declaration    wline(int x1,int y1,int x2,int y2)
  93.  
  94. Remarks        Replaces all needs for BGI's line command except where a 
  95.         line style other than SolidLn is required. Horizontal lines
  96.         are significantly faster than BGI's.
  97.  
  98. Restrictions    Does not allow for different line styles or thicknesses.
  99.  
  100. See also    wsetcolor
  101.  
  102.  
  103.  
  104.  
  105.  
  106. wcircle procedure
  107. ------------------------------------------------------------------------------
  108. Function    Draws a circle using (x,y) as the center point.
  109.         Operates on current color and graphics page.
  110.  
  111. Declaration    wcircle(int x,int y,int radius)
  112.  
  113. Remarks        The circle is drawn using the current color set by wsetcolor.
  114.         Aspect ratios are not used, therefore results may be slightly
  115.         different than the BGI counterpart.
  116.  
  117. See also    wsetcolor, wfill_circle
  118.  
  119.  
  120.  
  121.  
  122. wfill_circle procedure
  123.  
  124.  
  125.  
  126.  
  127.  
  128. ------------------------------------------------------------------------------
  129. Function    Draws a filled circle using (x,y) as the center point.
  130.  
  131. Declaration    wfill_circle(int x,int y,int radius)
  132.  
  133. Remarks        See wcircle
  134.  
  135.  
  136.  
  137.  
  138. wrectangle procedure
  139. ------------------------------------------------------------------------------
  140. Function    Draws a rectangle using the current color and graphics page.
  141.  
  142. Declaration    wrectangle(int x1,int y1,int x2,int y2)
  143.  
  144. Remarks        (x1,y1) define the upper left corner of the rectangle, and
  145.         (x2,y2) define the lower right. Faster than BGI equivalent.
  146.  
  147. See also    wsetcolor, wbar
  148.  
  149.  
  150.  
  151.  
  152. wbar procedure
  153. ------------------------------------------------------------------------------
  154. Function    Draws a filled rectangle with current color on active graphics
  155.         page.
  156.  
  157. Declaration    wbar(int x1,int y1,int x2,int y2)
  158.  
  159. Remarks        See wrectangle.
  160.  
  161.  
  162.  
  163.  
  164. wbutt procedure
  165. ------------------------------------------------------------------------------
  166. Function    Draws a 3-Dimensional button using the current colors and
  167.         graphics page.
  168.  
  169. Declaration    wbutt(int x1,int y1,int x2,int y2)
  170.  
  171. Remarks        (x1,y1) define the upper left corner of the button, and
  172.         (x2,y2) define the lower right. 
  173.         This uses automatically uses the color 253,254,and 255.
  174.         253 should be the lightest, and 255 should be darkest.
  175.         
  176.  
  177. See also    wsetcolor, wbar
  178.  
  179.  
  180. wregionfill procedure
  181. ------------------------------------------------------------------------------
  182. Function    Fills an area of the screen bounded by any color other than
  183.         that located at (x,y).
  184.  
  185. Declaration    wregionfill(int x,int y)
  186.  
  187. Remarks        Much more useful than the BGI FloodFill routine. It allows
  188.         multiple colors to be used as the border color. You must make
  189.         sure the stack size is large enough to handle complex fills.
  190.         If you get a stack overflow error, put this line at the 
  191.         start of your program:
  192.         _stklen= (a number of bytes for the stack, biggest is 64000)
  193.         See example program 8 (wgt08.c) for an example of this.        
  194.  
  195. See also    wsetcolor
  196.  
  197.  
  198.  
  199.  
  200. Color Manipulation:
  201. ~~~~~~~~~~~~~~~~~~~
  202.  
  203. wsetcolor procedure
  204. ------------------------------------------------------------------------------
  205. Function    Sets the current drawing color using the palette.
  206.  
  207. Declaration    wsetcolor(int color)
  208.  
  209. Remarks        Color may be in the range (0..255). All drawing procedures
  210.         used after setting this will use the color you choose.
  211.  
  212. See also    wsetrgb,wsetpalette,wloadpalette,wsavepalette
  213.  
  214.  
  215.  
  216. wsetpalette procedure
  217. ------------------------------------------------------------------------------
  218. Function    Sets a group of colors from a specified palette variable.
  219.  
  220. Declaration    wsetpalette(int start,int finish, color *palette)
  221.  
  222. Remarks        Colors from Start to Finish are set using the values stored
  223.         in the Palette variable. The variable type PALETTE is
  224.         specific to WGT and may not be used elsewhere. It is
  225.         defined as follows:
  226.  
  227.             typedef struct {
  228.             unsigned char r,g,b;
  229.             } color;
  230.  
  231.         To define a palette, you must make an array of colors like
  232.         this:
  233.  
  234.         color palette[256];
  235.  
  236.         The Red,Green, and Blue values are in the range (0..63)
  237.         giving a total of 256000 color combinations possible.
  238.  
  239. See also    wsetrgb, wloadpalette, wsavepalette, wsetcolor
  240.  
  241.  
  242. wsetrgb procedure
  243. ------------------------------------------------------------------------------
  244. Function    Sets a color's red, green, and blue values.
  245.  
  246. Declaration    wsetrgb(int color,int red,int green, int blue, color *palette)
  247.  
  248. Remarks        Color can range from 0 to 255. 
  249.         The Red,Green, and Blue values are in the range (0..63)
  250.         giving a total of 256000 color combinations possible.
  251.         
  252.         The colors do NOT change until you give a wsetpalette
  253.         command.  This way you can change a number of colors
  254.         and change them at the same time.
  255.  
  256.         Since the palette is stored as an array, not a pointer, you
  257.         must use the & sign when you pass the palette. EG:
  258.  
  259.         color palette[256];  // palette defined
  260.         wsetrgb(1,63,63,63,&palette); // sets color 1 to white
  261.  
  262.  
  263.  
  264. See also    wsetpalette, wloadpalette, wsavepalette, wsetcolor
  265.  
  266.  
  267.  
  268. wcolrotate procedure
  269. ------------------------------------------------------------------------------
  270. Function    Cycles the colors within a specified group from a palette
  271.         variable.
  272.  
  273. Declaration    wcolrotate(int start,int finish,int direction,color palette[255])
  274.  
  275. Remarks        This routine takes the colors from Start to Finish and shifts
  276.         them one in the direction specified by direction. Direction
  277.         can either be 0 for up, or 1 for down. This effect can
  278.         be used to simulate animation.
  279.  
  280. See also    wsetrgb, wfade_in, wfade_out
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287. wfade_in    Procedure
  288. ------------------------------------------------------------------------------
  289. Function    Gradually fades in a group of colors from a palette variable
  290.         (using a specified speed).
  291.  
  292. Declaration    wfade_in(int start,int finish,int speed, color palette[255]);
  293.  
  294. Remarks        The colors from Start to Finish are faded in starting from
  295.         black. The speed may range from (0..255), and is similar to
  296.         using the DELAY command between each change of the colors.
  297.  
  298. See also     wfade_out, wsetrgb, wsetpalette
  299.  
  300.  
  301.  
  302.  
  303. wfade_out procedure
  304. ------------------------------------------------------------------------------
  305. Function    Gradually fades out a group of colors from a palette variable
  306.         (using a specified speed).
  307.  
  308. Declaration    wfade_out(int start,int finish,int speed,color palette[255]);
  309.  
  310. Remarks        Same as wfade_in except colors fade from palette to black.
  311.  
  312. See also    wfade_in, wsetrgb, wsetpalette
  313.  
  314.  
  315.  
  316.  
  317. wloadpalette procedure
  318. ------------------------------------------------------------------------------
  319. Function    Load a 768 byte palette file from disk into a palette
  320.         variable.
  321.  
  322. Declaration    wloadpalette(char filename[12],color *palette)
  323.  
  324. Remarks        Palette files created by WGT or popular graphics programs may
  325.         be loaded into the variable specified by palette. Changes are not
  326.         made to the currently displayed palette. A good example of
  327.         compatibility would be the AutoDesk Animator. It's .COL files
  328.         are of this type. Many commercial games use these files as
  329.         well.
  330.  
  331.         The filename has space for an 8 character name, a period, and
  332.         a 3 character extension.
  333.  
  334. See also    wsavepalette, wsetpalette, wsetrgb
  335.  
  336.  
  337.  
  338.  
  339.  
  340. wsavepalette procedure
  341. ------------------------------------------------------------------------------
  342. Function    Save a palette variable's contents to a disk file.
  343.  
  344. Declaration    wsavepalette(char filename[12], color *palette);
  345.  
  346. Remarks        Creates a 768 byte palette file to disk from a variable
  347.         specified by palette. This is useful for storing different
  348.         palettes for games and their various screens.
  349.  
  350. See also    wloadpalette, wsetpalette, wsetrgb
  351.  
  352.  
  353.  
  354.  
  355. Block Manipulation:
  356. ~~~~~~~~~~~~~~~~~~~
  357.  
  358. wnewblock procedure
  359. ------------------------------------------------------------------------------
  360. Function    Stores a section of the screen in memory at a location pointed
  361.         to by a pointer variable.
  362.  
  363. Declaration    block wnewblock(int x1,int y1,int x2,int y2)
  364.  
  365. Remarks        Dynamic memory is used to automatically calculate the size of
  366.         the data, and to store it in a format compatible with BGI's
  367.         GETIMAGE. This procedure replaces the need for the combination
  368.         of IMAGESIZE, GETMEM, and GETIMAGE used in the BGI (although
  369.         all of WGT's block commands may be used interchangeably with
  370.         the BGI versions). Simply define a block at the beginning of
  371.         your program and call this routine.
  372.  
  373.         example:
  374.         block something;
  375.         void main(void)
  376.          {
  377.          ...
  378.          something=wnewblock(50,50,60,60);
  379.          ...
  380.          }
  381.  
  382. See also    wgetblockwidth, wgetblockheight, wflipblock, wputblock,
  383.         wresizeblock, wfreeblock, wloadblock, wsaveblock, wloadpak,
  384.         wsavepak
  385.  
  386.  
  387. wgetblockwidth function
  388. ------------------------------------------------------------------------------
  389. Function    Returns width of a previously stored block.
  390.  
  391. Declaration    int wgetblockwidth(block blockname);
  392.  
  393. Result Type    Integer
  394.  
  395.  
  396.  
  397.  
  398. wgetblockheight function
  399. ------------------------------------------------------------------------------
  400. Function    Returns height of a previously stored block.
  401.  
  402. Declaration    wgetblockheight(block blockname);
  403.  
  404. Result Type    Integer;
  405.  
  406.  
  407.  
  408.  
  409.  
  410. wflipblock procedure
  411. ------------------------------------------------------------------------------
  412. Function    Flips a block in one of two directions (block is physically
  413.         changed in memory, not on screen).
  414.  
  415. Declaration    wflipblock(block blockname, int direction);
  416.  
  417. Remarks        This procedure will flip a previously stored image either
  418.         vertically or horizontally. The stored image is physically
  419.         changed, and therefore the results will not be seen until
  420.         the block is displayed.
  421.  
  422.         direction is defined as the following:
  423.  
  424.         #define vertical 0;
  425.         #define horizontal 1;
  426.  
  427.  
  428. See also    wputblock, wnewblock, wresizeblock, wfreeblock
  429.  
  430.  
  431.  
  432.  
  433. wputblock procedure
  434. ------------------------------------------------------------------------------
  435. Function    Plots a previously stored image on the current graphics page.
  436.  
  437. Declaration    wputblock(int x,int y, block blockname, int mode)
  438.  
  439. Remarks        This is similar to the BGI PUTIMAGE. It displays an image
  440.         starting from the upper left corner at (x,y). Two modes are
  441.         supported for the method. They are:
  442.  
  443.         0 = Normal
  444.         1 = XRay
  445.  
  446.         The XRayPut uses the current transluscent color as a sort of
  447.         "see-through" color. Any occurence of this color is not
  448.         drawn on the screen. This is useful for drawing sprites
  449.         which overlay a background screen. 
  450.  
  451. See also    wsettransluscent, wgettransluscent, wnewblock
  452.  
  453.  
  454.  
  455.  
  456. wresizeblock procedure
  457. ------------------------------------------------------------------------------
  458. Function    Draws a previously stored image on the screen to fit within a
  459.         given boundary.
  460.  
  461. Declaration    wresizeblock(int x1,int y1,int x2,int y1, block blockname);
  462.  
  463. Remarks        A very fast shrink/expand routine for blocks. It will redraw
  464.         an image to fit perfectly within the area defined by
  465.         (x1,y1,x2,y2). In this manner, entire screens can be shrunk
  466.         down as icons, or small images can "explode". Image in memory
  467.         is not affected.
  468.  
  469.  
  470.  
  471.  
  472. wfreeblock procedure
  473. ------------------------------------------------------------------------------
  474. Function    Releases memory used to store an image.
  475.  
  476. Declaration    wfreeblock(block blockname)
  477.  
  478. Remarks        Used when a program is finished with a stored image. This is
  479.         similar to the BGI FREEMEM. You must use this to free memory
  480.         from all blocks previously allocated by wnewblock or other
  481.         block loading procedures before you exit your program,
  482.         or you will encounter memory errors.
  483.  
  484. See also    wnewblock
  485.  
  486.  
  487.  
  488.  
  489. wloadblock procedure
  490. ------------------------------------------------------------------------------
  491. Function    Loads a previously saved image from disk into a pointer.
  492.  
  493. Declaration    block wloadblock(char *filename)
  494.  
  495. Remarks        wloadblock automatically initializes the appropriate amount
  496.         of memory and loads the data. There is no need for a call
  497.         to wnewblock (in fact, don't do it or this won't work).
  498.  
  499. Returns:    Pointer to the loaded block. If the block could not be
  500.         found on disk, it returns NULL.
  501.  
  502. See also    wsaveblock
  503.  
  504.  
  505.  
  506.  
  507.  
  508. wsaveblock procedure
  509. ------------------------------------------------------------------------------
  510. Function    Saves a previously stored image to a file on disk.
  511.  
  512. Declaration    int wsaveblock(char *filename, block blockname)
  513.  
  514. Remarks        A file is created which holds the data stored at the pointer
  515.         given by BLOCKNAME. This allows your programs to load in
  516.         images for use later.
  517.  
  518. Returns:    0 if succesful, 1 if it could not save the file
  519.  
  520. See also    wloadblock, wnewblock, wfreeblock
  521.  
  522.  
  523.  
  524.  
  525.  
  526. wloadpak procedure
  527. ------------------------------------------------------------------------------
  528. Function    Loads a previously stored image from disk in compressed
  529.         format.
  530.  
  531. Declaration    block wloadpak(char *filename)
  532.  
  533. Remarks        This is similar to wloadblock except that the image is
  534.         in a file which was created by wsavepak. The compression used
  535.         is "similar" to PCX format (sometimes better). The more
  536.         simplistic the image, the smaller the file.
  537.  
  538. Returns:    Pointer to the loaded block. If the block could not be
  539.         found on disk, it returns NULL.
  540.  
  541. See also    wsavepak, wloadblock
  542.  
  543.  
  544.  
  545. wsavepak procedure
  546. ------------------------------------------------------------------------------
  547. Function    Saves a block to disk in compressed format.
  548.  
  549. Declaration    int wsavepak(char *filename,block blockname)
  550.  
  551. Remarks        This is similar to wsaveblock except that the image is
  552.         in a file which is compressed. The compression used
  553.         is "similar" to PCX format (sometimes better). The more
  554.         simplistic the image, the smaller the file.
  555.  
  556. Returns:    0 if succesful, 1 if it could not save the file
  557.  
  558. See also    wloadpak, wloadblock
  559.  
  560.  
  561.  
  562.  
  563. wloadpcx256 procedure
  564. ------------------------------------------------------------------------------
  565. Function    Loads a PCX file (320*200*256 only) onto the current graphics
  566.         page.
  567.  
  568. Declaration    wloadpcx256(char *filename, color *palette);
  569.  
  570. Remarks        The file MUST be a full screen and be in 256 color mode.
  571.         New version looks for the palette at the end of the PCX file.
  572.  
  573.  
  574.  
  575.  
  576. Mouse Functions:
  577. ~~~~~~~~~~~~~~~~
  578.  
  579.  
  580. minit procedure
  581. ------------------------------------------------------------------------------
  582. Function    Initializes the mouse.
  583.  
  584. Declaration    int minit();
  585.  
  586. Remarks        Simply starts up the mouse. You should use this first if you
  587.         want to use the mouse. Returns the number of buttons the mouse
  588.         has if it is installed.
  589.  
  590. See also    mon,moff,mread,noclick,msetbounds,mouseshape,msetspeed,
  591.         msetthreshhold
  592.  
  593.  
  594. msetbounds procedure
  595. ------------------------------------------------------------------------------
  596. Function    Sets the area to confine the mouse cursor to.
  597.  
  598. Declaration    msetbounds(int minx,int miny,int maxx,int maxy)
  599.  
  600. Remarks        The cursor will be restricted movement within the specified
  601.         region after this routine is called.
  602.  
  603. See also    minit,mon,moff,mread,noclick,mouseshape,msetspeed,
  604.         msetthreshhold
  605.  
  606.  
  607.  
  608.  
  609. mon procedure
  610. ------------------------------------------------------------------------------
  611. Function    Displays the mouse cursor.
  612.  
  613. Declaration    mon()
  614.  
  615. Remarks        If the mouse is displayed while you are using some drawing
  616.         procedures, it will mess up the screen if you move it over
  617.         the area being updated.  Turn it off during all drawing
  618.         procedures.
  619.  
  620. See also    minit,moff,mread,noclick,msetbounds,mouseshape,msetspeed,
  621.         msetthreshhold
  622.  
  623.  
  624.  
  625.  
  626.  
  627. moff procedure
  628. ------------------------------------------------------------------------------
  629. Function    Turns off display of the mouse cursor.
  630.  
  631. Declaration    moff()
  632.  
  633. Remarks        See mon.
  634.  
  635. See also    minit,mon,mread,noclick,msetbounds,mouseshape,msetspeed,
  636.         msetthreshhold
  637.  
  638.  
  639.  
  640.  
  641.  
  642. mread procedure
  643. ------------------------------------------------------------------------------
  644. Function    Returns the current button pressed, as well as X and Y
  645.         coordinates.
  646.  
  647. Declaration    mread()
  648.  
  649. Remarks        Three global variables are updated when you call this
  650.         procedure.  mx and my are the mouse coordinates, and
  651.         but is the button state.
  652.         Buttons are commonly returned as 1 for left, 2 for right,
  653.         and 4 for the middle button of a 3 button mouse. 0 is returned
  654.         if none are pressed.
  655.  
  656.  
  657. See also    minit,mon,moff,noclick,msetbounds,mouseshape,msetspeed,
  658.         msetthreshhold
  659.  
  660.  
  661.  
  662. noclick procedure
  663. ------------------------------------------------------------------------------
  664. Function    Waits until all buttons are released.
  665.  
  666. Declaration    noclick()
  667.  
  668. Remarks        This is useful if you want the user to click on a button,
  669.         update something, and wait for another button click.
  670.         Without this command, the user could hold down the button
  671.         and the program will think you pressed it a bunch of times.
  672.         Put this command in after you have found the user pressed
  673.         a button.  Example:
  674.         
  675.         mread();
  676.         if (but==1)
  677.           {
  678.           noclick();
  679.           ctr++;
  680.           }
  681.  
  682.  
  683. See also    minit,mon,mread,msetbounds,mouseshape,msetspeed,
  684.         msetthreshhold
  685.  
  686.  
  687.  
  688. mouseshape procedure
  689. ------------------------------------------------------------------------------
  690. Function    Sets the bitmap and hotspot of the mouse cursor.
  691.  
  692. Declaration    mouseshape(int rowhot,int colhot, void far *bitmap)
  693.  
  694. Remarks        This procedure sets the cursor hotspot as defined by the
  695.         variables ROWHOT and COLHOT. Each are in the range (0..15).
  696.         The actual bitmap information is stored in an array of
  697.         integers called bitmap. It is defined as follows:
  698.  
  699.         The first 16 words are used to set the cursor shape, while the
  700.         last 16 words set the mask. Several shareware programs are
  701.         available to create the data required for these cursors if
  702.         you are unfamiliar with bit operations.
  703.  
  704.  
  705. See also    minit,mon,moff,mread,noclick,msetbounds,msetspeed,
  706.         msetthreshhold
  707.  
  708.  
  709. msetspeed procedure
  710. ------------------------------------------------------------------------------
  711. Function    Sets the speed of the mouse.
  712.  
  713. Declaration    msetspeed(int x_speed,int y_speed)
  714.  
  715. Remarks        Sets the speed of the mouse in each direction. 10 is about
  716.         average for both values.  1 is fast, 40 is slower.
  717.         In other words, if you set the speed to be 40 for the x, and
  718.         1 for the y, you will have to move the mouse a greater
  719.         distance horizontally to move the cursor one pixel. On the
  720.         other hand, you can move the cursor very quickly up and down.
  721.  
  722.  
  723. See also    minit,mon,moff,mread,noclick,msetbounds,mouseshape,
  724.         msetthreshhold
  725.  
  726.  
  727.  
  728. msetthreshhold procedure
  729. ------------------------------------------------------------------------------
  730. Function    Sets the speed the mouse must be before it doubles its 
  731.         movements.
  732.  
  733. Declaration    msetthreshhold(int speed)
  734.  
  735. Remarks        See mon.
  736.  
  737. See also    minit,mon,moff,mread,noclick,msetbounds,mouseshape,msetspeed
  738.  
  739.  
  740.  
  741.  
  742. Screen Operations:
  743. ~~~~~~~~~~~~~~~~~~
  744.  
  745. wsetscreen procedure
  746. ------------------------------------------------------------------------------
  747. Function    Makes all drawing procedures use a different video page
  748.  
  749. Declaration    wsetscreen(block screenname)
  750.  
  751. Remarks        The screen must be first initialized by using wnewblock
  752.         with coords 0,0 to 319,199. 
  753.  
  754. See also    wnewblock,wfreeblock
  755.  
  756.  
  757. wnormscreen procedure
  758. ------------------------------------------------------------------------------
  759. Function    Sets the active page back to the original visual page
  760.  
  761. Declaration    wnormscreen()
  762.  
  763. Remarks        This is used to return all drawing operations to the normal
  764.         screen.
  765.  
  766. See also    wnewblock,wfreeblock
  767.  
  768.  
  769. wcopyscreen procedure
  770. ------------------------------------------------------------------------------
  771. Function    Copies a section of one screen onto a different WGT page.
  772.  
  773. Declaration    wcopyscreen(int x1,int y1,int x2,int y2,block source,
  774.          int dx,int dy, block dest)
  775.  
  776. Remarks        This command can seem confusing, but is very powerful, and
  777.         necessary when using multiple graphics pages. A second page
  778.         must be initialized by getting a block with dimensions
  779.         320 by 200 before this command can be used. 
  780.  
  781.         The area defined by (x1,y1,x2,y2) is copied from the screen
  782.         described by SOURCE, and is placed with the upper left corner
  783.         at (dx,dy) on the screen referred to by DEST. For example,
  784.         to copy screen SECOND(entirely) to the screen FIRST, type
  785.         wcopyscreen(0,0,319,199,SECOND,0,0,FIRST). The visual page
  786.         can be accesed by replacing the destination or source with
  787.         NULL.
  788.  
  789.           For example to copy FIRST to the visual page:
  790.         wcopyscreen(0,0,319,199,FIRST,0,0,NULL);
  791.           or the other way around:
  792.         wcopyscreen(0,0,319,199,NULL,0,0,FIRST);
  793.  
  794.  
  795. wfade    procedure
  796. ------------------------------------------------------------------------------
  797. Function    Dissolves a screen of memory onto the active screen.
  798.  
  799. Declaration    wfade(block sourcescreen, int *pattern, int speed)
  800.  
  801. Remarks        The screen described by SOURCESCREEN is dissolved onto the
  802.         active screen set by wsetscreen using the pattern specified
  803.         by pattern. Pattern is an array of integer.  It can be 
  804.         defined by the program called dissolve.exe, included with
  805.         WGT. After saving a pattern with this program, include the
  806.         code generated with your program, and pass it the array to
  807.         this procedure.
  808.         The speed is a DELAY command after each    pixel is copied.
  809.  
  810.  
  811.  
  812. wwipe    procedure
  813. ------------------------------------------------------------------------------
  814. Function    Draws a line but uses colours from another virtual screen.
  815.  
  816. Declaration    wwipe(int x1,int y1, int x2,iny y2,block screen)
  817.  
  818. Remarks        This special effect allows you to draw a line on the screen,
  819.         but instead of using one colour, each pixel drawn is the   
  820.         colour of the pixel at the same location on the block  
  821.         screen. You can created impressive wipes and make your    
  822.         programs look very professional.  You will want to make   
  823.         one or more 'for' statements that copy the whole screen over
  824.         since this only does it one at a time.  The lines don't have
  825.         to be horizontal or vertical, so you can create complex
  826.         patterns with the lines.
  827.  
  828.  
  829.  
  830. Text functions:
  831. ~~~~~~~~~~~~~~~
  832.  
  833.  
  834. wouttextxy procedure
  835. ------------------------------------------------------------------------------
  836. Function       Outputs a string of text on the graphics page at (x,y).
  837.  
  838. Declaration    wouttextxy(int x,int y, char *string)
  839.  
  840. Remarks        Same as BGI version except it works on any graphics page.
  841.                X/Y coordinate system may be 40*25 or 320*200 (see the
  842.            wtextgrid procedure).
  843.  
  844. See also       wtextcolor, wtextbackground, wtextgrid, wtexttransparent,
  845.            wtextcursor, wstring
  846.  
  847.  
  848. wtextbackground procedure
  849. ------------------------------------------------------------------------------
  850. Function       Sets the background text color.
  851.  
  852. Declaration    wtextbackground(unsigned char color)
  853.  
  854. Remarks        Color is in the range (0..255). Background may be turned off
  855.            for output by using wtexttransparent.
  856.  
  857. See also       wouttextxy,wtextcolor, wtextgrid,
  858.            wtexttransparent, wtextcursor, wstring
  859.  
  860.  
  861.  
  862. wtextcolor procedure
  863. ------------------------------------------------------------------------------
  864. Function       Selects the foreground character color.
  865.  
  866. Declaration    wtextcolor(unsigned char color)
  867.  
  868. Remarks        Color is in the range (0..255). Foreground may be turned off
  869.            during output by setting wtexttransparent.
  870.  
  871. See also       wouttextxy, wtextbackground, wtextgrid,
  872.            wtexttransparent, wtextcursor, wstring
  873.  
  874.  
  875.  
  876.  
  877. wsetcursor procedure
  878. ------------------------------------------------------------------------------
  879. Function       Sets the shape of the text cursor.
  880.  
  881. Declaration    wsetcursor(int y,int y2)
  882.  
  883. Remarks        Y and Y2 coordinates are the coordinates for the upper and
  884.            lower lines for a box 8 pixels wide. The X coordinates are
  885.            fixed to 8 pixels wide. The cursor is not the hardware text
  886.            cursor, but rather a software simulation which flashes during
  887.            text input. A solid box would be (0,7).
  888.  
  889. See Also       wstring
  890.  
  891.  
  892.  
  893.  
  894. wtextgrid procedure
  895. ------------------------------------------------------------------------------
  896. Function       Switches the text addressing system from 320*200 to 40*25.
  897.  
  898. Declaration    wtextgrid(int state)
  899.  
  900. Remarks        Text may be output in regular graphics coordinates (320*200) or
  901.            a text mode system of 40*25. If STATE is set to 1, all input
  902.            and output values for WGT text functions are expected to be
  903.            in the 40*25 range. Characters will be 'snapped' to the grid as
  904.            if it were a text mode. 0 will use regular graphics system
  905.            coordinates.
  906.  
  907. See Also       wouttextxy, wstring
  908.  
  909.  
  910.  
  911.  
  912.  
  913. wstring procedure
  914. ------------------------------------------------------------------------------
  915. Function       Reads in a string of text from the keyboard and displays
  916.                both the text and a simulated cursor on the graphics page.
  917.  
  918. Declaration    int wstring(int x,int y, char *instring, char *legal, int num)
  919.                  
  920. Remarks        X and Y are the coordinates to read the string in from.
  921.            This procedure uses the flashing cursor while you input the
  922.            string. Any characters you wish to be able to type in must
  923.            be included in LEGAL.  For example, if you want a yes or
  924.            no answer only, make LEGAL="YNyn". NUM is the maximum number
  925.            of letters in the string.
  926.  
  927.            INSTRING must be a pointer to char, example
  928.             char *filename;
  929.            Along with legal:
  930.             char *legal_chars = " ABCDEFGHIJKLMNOPQRSTUVWXYZ
  931.                abcdefghijklmnopqrstuvwxyz1234567890_.";
  932.         
  933.            Then, you must allocate memory for the string, like this:
  934.             filename = (char *) malloc (13);      
  935.            Add 1 to the length for the null terminator.
  936.  
  937.            Call the string procedure:
  938.                wstring(10,22,filename,legal_chars,12);
  939.  
  940.            After you're done with the string, free the memory by
  941.             free(filenameout);
  942.  
  943.            INSERT,DELETE,HOME,END and the arrow keys are functional,
  944.            backspace is destructive.
  945.            If you press insert, the cursor shape changes and toggles
  946.            between insert and overwrite modes.
  947.  
  948. See Also       wtextcolor, wtextbackground, wtextgrid, wtexttransparent
  949.  
  950.  
  951.  
  952.  
  953. wtexttransparent procedure
  954. ------------------------------------------------------------------------------
  955. Function       Sets text output to supress display of foreground or
  956.                background.
  957.  
  958. Declaration    wtexttransparent(int mode)
  959.  
  960. Remarks        This will turn off the display of either the foreground or the
  961.            background, or set it to show both.
  962.            The values possible are:
  963.            0: Background turned off
  964.            1: Foreground turned off
  965.            2: Both turned on
  966.  
  967.  
  968. wflashcursor procedure
  969. ------------------------------------------------------------------------------
  970. Function       Flash the cursor using the values set by wsetcursor and
  971.            the global variable curspeed.
  972.  
  973. Declaration    wflashcursor()
  974.  
  975. Remarks        Uses the cursor coordinates set by the global variables
  976.            xc and yc. Curspeed is another global variable which can
  977.            be set to change the flashing speed.
  978.  
  979.  
  980.  
  981. Sprite Procedures:
  982. ~~~~~~~~~~~~~~~~~~
  983.  
  984. All sprite procedures have been moved into wspr.lib. Please
  985. see the documentation for that library. 
  986.  
  987.  
  988. Misc:
  989. ~~~~~
  990.  
  991. wretrace procedure
  992. ------------------------------------------------------------------------------
  993. Function       Waits for the vertical retrace.
  994.  
  995. Declaration    wretrace()
  996.  
  997. Remarks        Use when you get flickering graphics.
  998.