home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d186 / cards'o'rama.lha / Cards'O'Rama / Sources / sources.zoo / writestring.c < prev   
Text File  |  1989-02-25  |  1KB  |  45 lines

  1. /*                               writestring.c                          */
  2. /*                                                                      */
  3. /* I need this one to print various strings during the game: I want the */
  4. /* string to be just in the bottom of the screen and I want it centered */
  5. /* and shadowy too...                                                   */
  6.  
  7.  
  8. writestring(rport, string, color)
  9.    struct RastPort *rport;
  10.    char string[];
  11.    int color;
  12.    {
  13.    int length;
  14.    int pixels;
  15.    int xoffset;
  16.    int baseline;
  17.  
  18.    baseline = rport -> TxBaseline;
  19.    length = strlen(string);
  20.    pixels = TextLength(rport, string, length);
  21.    xoffset = (SCWIDTH - pixels) / 2;
  22.  
  23. /* First I want to draw the shadow */
  24.  
  25.    if (color == FALSE)
  26.       SetAPen(rport, 6);
  27.    else
  28.       SetAPen(rport, 7);
  29.  
  30.    Move(rport, xoffset + 1, YOFFSET_SHADOW + baseline);
  31.    Text(rport, string, length);
  32.  
  33. /* And now I can write the real string */
  34.  
  35.    if (color == FALSE)
  36.       SetAPen(rport, 6);
  37.    else
  38.       SetAPen(rport, color);
  39.  
  40.    Move(rport, xoffset - 1, YOFFSET + baseline);
  41.    Text(rport, string, length);
  42.    return(0);
  43.    }
  44.  
  45.