home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / swag / textwndw.swg / 0003_SHADOW2.PAS.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-05-28  |  831 b   |  26 lines

  1. {
  2. I Write the following Procedure to shadow Text behind a box.  It works
  3. fine (so Far), but am not sure if there is a quicker, easier way.
  4. }
  5.  
  6. Procedure Shadow(x, y, xlength, ylength : Byte);
  7. Var
  8.   xshad,
  9.   yshad : Word;
  10.   i     : Byte;
  11. begin
  12.   xlength := xlength shl 1;     { xlength * 2 }
  13.   xshad := ((x*2)+(y*160)-162) + ((ylength+1) * 160) + 4;   { x coord }
  14.   yshad := ((x*2)+(y*160)-162) + (xlength);                 { y coord }
  15.   if Odd(Xshad) then Inc(XShad);            { we want attr not Char }
  16.   if not Odd(YShad) then Inc(YShad);        { " }
  17.   For i := 1 to xlength Do
  18.     if Odd(i) then
  19.       Mem[$B800:xshad+i] := 8;              { put x shadow }
  20.   For i := 1 to ylength Do
  21.   begin
  22.     Mem[$B800:yshad+(i*160)] := 8;          { put y shadows }
  23.     Mem[$B800:yshad+2+(i*160)] := 8
  24.   end
  25. end;
  26.