home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / FSGFX.ZIP / G_GETS.C < prev    next >
C/C++ Source or Header  |  1990-03-06  |  809b  |  58 lines

  1. /* g_gets.c */
  2. /* get a string in graphics mode */
  3.  
  4. #include "mygraph.h"
  5.  
  6. g_gets(locx,locy,temp)
  7. int locx;
  8. int locy;
  9. char temp[];
  10. {
  11.  
  12.     int i,x,y,j,k;
  13.     int letter;
  14.     char zchar;
  15.     unsigned char mask;
  16.     int spot;
  17.     unsigned char uchar;
  18.  
  19.     i = 0;
  20.     zchar = 0;
  21.     letter = 0;
  22.     if(locx < 0)
  23.         locx = oldtextx;
  24.     if(locy < 0)
  25.         locy = oldtexty;
  26.     
  27.     while(zchar != 0x0D)
  28.     {
  29.     zchar = getch();
  30.  
  31.         if(zchar != 0x0D)
  32.         {
  33.         letter = zchar - ' ';
  34.         temp[i++] = zchar;
  35.             for(y = 0; y<FONTH; y++)
  36.             {
  37.                 for(x = FONTW-1; x>=0; x--)
  38.                 {
  39.                     if(alphabet[letter][y][x])
  40.                     {
  41.                         j = locx+x;
  42.                         k = locy+y;
  43.                         g_macrodot(j,k);
  44.                     }
  45.                 }
  46.             }
  47.         if(locx < SCR_XMAX)
  48.             locx += FONTW;
  49.         else
  50.             locx = 0;
  51.         }
  52.     }
  53.     temp[i] = 0;
  54.     oldtextx = locx;    
  55.     oldtexty = locy;
  56. }
  57.  
  58.