home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / Graphics / PostScript / PSHacks / vslide.ps < prev   
Encoding:
Text File  |  1993-01-23  |  3.0 KB  |  106 lines

  1. %% vslide.ps
  2. %%
  3. %% Written April 29, 1990,
  4. %% Scott Hess
  5. %% NeXT Campus Consultant
  6. %% Gustavus Adolphus College
  7. %% St. Peter, Mn    56082
  8. %% scott@gacvax1.bitnet
  9. %%
  10. %% This program slides the left section of the Workspace off the screen to
  11. %% the bottom, slides the rest to cover that area, and loops until the whole
  12. %% screen is gone.
  13.  
  14. %% This file may be installed so that the Scene application will bring it up
  15. %% under the Movies menu.  To do this, create a directory within the
  16. %% /NextLibrary/Images/Scene_movies directory named vslide.movie.  Inside this
  17. %% directory, place this file, with the name vslide.script.ps.  Then, run
  18. %% Scene, and there you are.  This really belongs in the /LocalLibrary
  19. %% directory, but unfortunately, Scene will not find it there.  Sad, eh?
  20.  
  21. %% This code is freely released into the public domain.  You may cut/paste,
  22. %% slash, rearrange, remove comments, and otherwise mutilate this code
  23. %% with no fear of reprisal from myself.  So, go ahead!  I want to see more
  24. %% screen hacks, people!
  25.  
  26. %% scott
  27.  
  28. %% Grab the Workspace and draw it in the passed window.
  29. /getWorkspace    % window
  30. {
  31.   gstate /dest exch def
  32.   /tempwin 0 0 1120 832 Nonretained window def
  33.   tempwin windowdeviceround
  34.   /tgs gstate def
  35.  
  36.   false tempwin setautofill
  37.   Above 0 currentwindow orderwindow
  38.  
  39.   dest setgstate 0 0 1120 832 tgs 0 0 Copy composite
  40.   tempwin termwindow
  41. } def
  42.  
  43. %% Move a region of the current gstate.
  44. /shift            %% x y w h dx dy
  45. {
  46.   4 index add
  47.   exch 5 index add
  48.   exch
  49.   gstate
  50.   3 1 roll
  51.   Copy composite
  52. } def
  53.  
  54. %% Return after mouseclick accepted.
  55. /waitmouse
  56. {
  57.   { buttondown {exit} if} loop
  58.   { stilldown not {exit} if} loop
  59. } def
  60.  
  61. gsave
  62.   %% get a window the size of the Workspace.
  63.   /win 0 0 1120 832 Buffered window def
  64.   win windowdeviceround
  65.  
  66.   currentwindow getWorkspace
  67.  
  68.   %% Move the psuedo-Workspace to the front.
  69.   Above 0 win orderwindow
  70.  
  71.   %% How fast to shift.  Not really needed, now.
  72.   /shiftby 4 def
  73.   
  74.   0.0 setgray                %% leave behind Black
  75.   40                    %% 40 strips of 23 pixels wide.
  76.     {
  77.       0 0 56 832 0 shiftby neg shift    %% shift the strip to the bottom.
  78.       0 832 shiftby sub 56 shiftby rectfill
  79.                     %% and fill in the opened area.
  80.       flushgraphics            %% flush that.
  81.       shiftby shiftby 832        %% shift all the way across.
  82.     {
  83.       pop                %% forget that number.
  84.       0 0 56 832 0 shiftby neg shift %% shift the strip to the bottom.
  85.                     %% (don't have to fill in opened
  86.                     %% area anymore :-)
  87.       flushgraphics            %% flush the output.
  88.       buttondown {exit} if        %% if button is down, leave.
  89.     } for
  90.       buttondown {exit} if        %% get out right away in case of button.
  91.       0 0 1120 832 -56 0 shift        %% slide screen left.
  92.       1064 0 56 832 rectfill        %% fill in the right.  Note that the
  93.                     %% same thing as above could be
  94.                     %% done, just not so easy, now.
  95.       (../../../NextLibrary/Sounds/Bonk.snd) 1 playsound
  96.                     %% Bonk.
  97.       flushgraphics            %% make sure the user sees it!.
  98.       buttondown {exit} if        %% could have been a buttondown in there.
  99.     }
  100.   repeat
  101.   waitmouse                %% wait for that buttondown.
  102.  
  103.   win termwindow            %% get rid of the window.
  104. grestore
  105.  
  106.