home *** CD-ROM | disk | FTP | other *** search
- {-- This program illustrates how an image can be hidden then displayed }
- {-- again at a different screen location. }
- Uses
- tgraph,
- TEGLIntr,
- TEGLUnit,
- TEGLMain;
-
- VAR fs : ImageStkPtr;
- i,dx,dy : word;
-
-
-
- BEGIN
-
- EasyTEGL;
- EasyOut;
-
-
- PushImage(1,1,50,50);
- ShadowBox(1,1,50,50);
- fs := StackPtr;
-
- i := 20000; {-- counter }
- dx := 0; {-- simple delta for the frame }
- dy := 0;
- REPEAT
- i := i - 1;
- IF i=100 THEN
- HideImage(fs); {-- just hides the image, doesn't dispose }
- IF i=0 then
- BEGIN
- dx := dx + 3;
- dy := dy + 2;
-
- {-- check for screen boundaries }
- IF ((dx > getmaxx - 60) OR (dy > getmaxy-60)) THEN
- BEGIN
- dx := 1;
- dy := 1;
- END;
- {-- show image places the image at the new location. If you want }
- {-- to display it at it's orginal location use the imagestackptr }
- {-- x and y, they are the same as when it was hidden. }
- ShowImage(fs,dx,dy);
- i := 4000;
- END;
- UNTIL Mouse_Buttons<>0;
-
- IF i<=100 THEN
- ShowImage(fs,fs^.x,fs^.y);
-
- TEGLSupervisor;
- END.
-