Board index » delphi » Making a fade in , fade out procedure

Making a fade in , fade out procedure

I would be grateful if someone could send me a fade in and fade out
procedure in
Pascal. By the way does anyone know how to make a nice looking
starfield??

 

Re:Making a fade in , fade out procedure


Quote
jeffrey wrote:

> I would be grateful if someone could send me a fade in and fade out
> procedure in
> Pascal. By the way does anyone know how to make a nice looking
> starfield??

Not tested, but here it is: (using the VGA palette like in mode 13h)

PROCEDURE FadeIn;
VAR i,r,g,b : byte;
    c       : byte;
BEGIN
 for c:=0 to 64 do begin
   for i:=0 to 255 do begin
        port[$03c7]:=i;
        r:=port[$03c9];
        g:=port[$03c9];
        b:=port[$03c9];
        if r>0 then dec(r);
        if g>0 then dec(g);
        if b>0 then dec(b);
        port[$03c8]:=i;
        port[$03c9]:=r;
        port[$03c9]:=g;
        port[$03c9]:=b;
   end;
   {=-=- you should wait for a vertical retrace here,but this will work
too =-=-=-=}
   delay(50);
 end;
END;

For a fadein, simple increase the colors and check for <63

And the starfield, would that be 2D or one of those rotating 3D
thingies?

Greets,
--
Pascal Bestebroer
Just4Fun Productions
internet: http://people.zeelandnet.nl/rpb/index.html
e-mail  : just4...@zeelandnet.nl
ICQ     : 2309110
*******************************************************

Re:Making a fade in , fade out procedure


Quote
jeffrey wrote:

> I would be grateful if someone could send me a fade in and fade out
> procedure in
> Pascal. By the way does anyone know how to make a nice looking
> starfield??

Have a look at http://www.xs4all.nl/~remcodek/program.html#fades.
It's all there.

Good luck,

Remco de Korte
Soft Machine
Nederland

Other Threads