home *** CD-ROM | disk | FTP | other *** search
- %% vslide.ps
- %%
- %% Written April 29, 1990,
- %% Scott Hess
- %% NeXT Campus Consultant
- %% Gustavus Adolphus College
- %% St. Peter, Mn 56082
- %% scott@gacvax1.bitnet
- %%
- %% This program slides the left section of the Workspace off the screen to
- %% the bottom, slides the rest to cover that area, and loops until the whole
- %% screen is gone.
-
- %% This file may be installed so that the Scene application will bring it up
- %% under the Movies menu. To do this, create a directory within the
- %% /NextLibrary/Images/Scene_movies directory named vslide.movie. Inside this
- %% directory, place this file, with the name vslide.script.ps. Then, run
- %% Scene, and there you are. This really belongs in the /LocalLibrary
- %% directory, but unfortunately, Scene will not find it there. Sad, eh?
-
- %% This code is freely released into the public domain. You may cut/paste,
- %% slash, rearrange, remove comments, and otherwise mutilate this code
- %% with no fear of reprisal from myself. So, go ahead! I want to see more
- %% screen hacks, people!
-
- %% scott
-
- %% Grab the Workspace and draw it in the passed window.
- /getWorkspace % window
- {
- gstate /dest exch def
- /tempwin 0 0 1120 832 Nonretained window def
- tempwin windowdeviceround
- /tgs gstate def
-
- false tempwin setautofill
- Above 0 currentwindow orderwindow
-
- dest setgstate 0 0 1120 832 tgs 0 0 Copy composite
- tempwin termwindow
- } def
-
- %% Move a region of the current gstate.
- /shift %% x y w h dx dy
- {
- 4 index add
- exch 5 index add
- exch
- gstate
- 3 1 roll
- Copy composite
- } def
-
- %% Return after mouseclick accepted.
- /waitmouse
- {
- { buttondown {exit} if} loop
- { stilldown not {exit} if} loop
- } def
-
- gsave
- %% get a window the size of the Workspace.
- /win 0 0 1120 832 Buffered window def
- win windowdeviceround
-
- currentwindow getWorkspace
-
- %% Move the psuedo-Workspace to the front.
- Above 0 win orderwindow
-
- %% How fast to shift. Not really needed, now.
- /shiftby 4 def
-
- 0.0 setgray %% leave behind Black
- 40 %% 40 strips of 23 pixels wide.
- {
- 0 0 56 832 0 shiftby neg shift %% shift the strip to the bottom.
- 0 832 shiftby sub 56 shiftby rectfill
- %% and fill in the opened area.
- flushgraphics %% flush that.
- shiftby shiftby 832 %% shift all the way across.
- {
- pop %% forget that number.
- 0 0 56 832 0 shiftby neg shift %% shift the strip to the bottom.
- %% (don't have to fill in opened
- %% area anymore :-)
- flushgraphics %% flush the output.
- buttondown {exit} if %% if button is down, leave.
- } for
- buttondown {exit} if %% get out right away in case of button.
- 0 0 1120 832 -56 0 shift %% slide screen left.
- 1064 0 56 832 rectfill %% fill in the right. Note that the
- %% same thing as above could be
- %% done, just not so easy, now.
- (../../../NextLibrary/Sounds/Bonk.snd) 1 playsound
- %% Bonk.
- flushgraphics %% make sure the user sees it!.
- buttondown {exit} if %% could have been a buttondown in there.
- }
- repeat
- waitmouse %% wait for that buttondown.
-
- win termwindow %% get rid of the window.
- grestore
-
-