#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" ,easein2on preOpenStack set loc of me to the screenLoc end preOpenStack on editScript? if the optionKey is "down" then edit script of the target exit to metacard end if end editScript? `& uBallNumber1 Ease-In/Out ULucida GrandeU helvetica U helveticaUArial UArial UArial UArial UArial P -# THIS SCRIPT APPLIES DECELERATING OR # ACCELERATING MOVEMENT TO ANY OBJECT ON A # CARD. AS THE OBJECT APPROACHES ITS DESTINATION, # ITS SPEED CONTINUOUSLY DECREASES (EASE IN) OR # INCREASES (EASE OUT) WHICH CREATES MORE ORGANIC # LOOKING MOVEMENT THAN THE "MOVE" COMMAND. # # THIS BEHAVIOR IS TYPICALLY APPLIED TO THE BEGINNING # OR END OF AN OBJECT'S ANIMATION PATH BUT CAN ALSO # USED TO SIMPLY ANIMATE AN OBJECT'S POSITION. # # THE HANDLER REQUIRES 3 PARAMETERS: # 1) AN OBJECT DESCRIPTION IN THE FORM " " (IE "IMG BALL1") # 2) A METHOD IN THE FORM "IN" OR "OUT" # 3) THE DESIRED DURATION OF THE EASE ACTION IN MILLISECONDS # # NOTE: BEORE RUNNING THIS SCRIPT, AN OBJECT MUST BE # INITIALIZED WITH POSITION AND TIMING PROPERTIES # (SEE EASE-IN AND EAST-OUT BUTTON SCRIPTS). on easeObject tObj,tMethod,tTiming # ESTABLISH PHI VARIABLE do "put (the milliseconds - the uTime of" && tObj & ")/tTiming into phi" # REQUIRED FOR SHORT MOVE TIMES if phi > 1 then put 1 into phi # DETERMINE METHOD if tMethod = "in" then # EASE IN put (2*phi - phi^2) into F else # EASE OUT put phi^2 into F end if # MOVE OBJECT do "put the uStartX of" && tObj && "+ round(F * the uXdist of" && tObj & ") into newX" do "put the uStartY of" && tObj && "+ round(F * the uYdist of" && tObj & ") into newY" do "set loc of" && tObj && "to" && newX & "," & newY # EXIT WHEN OBJECT REACHES ITS DESTINATION LOCATION do "if (newX = the uTargetX of" && tObj && "and newY = the uTargetY of" && tObj & ") or (phi >= 1) then endEase" && quote & tObj & quote # OPTIONAL FADE-IN OF MOVING OBJECT do "if the hilite of btn _fade then set the blendLevel of" && tObj && "to 100-trunc(100*((the milliseconds - the uTime of" && tObj & ")/tTiming))" # LOOP SCRIPT send "easeObject" && q(tObj) & "," & q(tMethod) & "," & q(tTiming) to me in 10 milliseconds end easeObject # THIS HANDLER IS SEPARATED OUT FROM THE EASEOBJECT # HANDLER SO OTHER SCRIPT EVENTS CAN BE EASILY # TRIGGERED WHEN EASE-IN/OUT ACTION TERMINATES # FOR EACH MOVING OBJECT. on endEase tObj # put tObj && "is done moving." exit to metacard end endEase # OBJECT INITIALIZATION on initObj tObj,tDestLoc do "set the uStartX of" && tObj && "to item 1 of loc of" && tObj do "set the uStartY of" && tObj && "to item 2 of loc of" && tObj do "set the uTargetX of" && tObj && "to item 1 of (" & tDestLoc & ")" do "set the uTargetY of" && tObj && "to item 2 of (" & tDestLoc & ")" do "set the uXdist of" && tObj && "to (the uTargetX of" && tObj && "- the uStartX of" && tObj & ")" do "set the uYdist of" && tObj && "to (the uTargetY of" && tObj && "- the uStartY of" && tObj & ")" do "set the uTime of" && tObj && "to the milliseconds" end initObj # QUOTE FUNCTION function q tString return quote & tString & quote end q ffffff&  ($)*+&%' !" label1 Whitep  Duration (ms):   _duration+`>  600  _fade@eon mouseUp repeat with B = 1 to 8 if the hilite of me then set the blendLevel of img ("ball" & B) to 100 else set the blendLevel of img ("ball" & B) to 0 end repeat end mouseUp @JFade-In Moving Objects  copyright White]-  ;Ease-In was built by Tactile Media -- www.tactilemedia.com 4Math assistance generously provided by Richard Herz  instructions WhiteS  GClick the Ease-In, Ease-Out and Move buttons to compare the results...easeObject ScriptEp1on mouseUp edit script of this cd end mouseUp   ball1 BuXdist294uYdist0uStartX31uTime 1057441267999 uTargetX325uStartY80 uTargetY80PNG  IHDRAgAMAOX2tEXtSoftwareAdobe ImageReadyqe<LIDATxba3D\Đ.$/w~z3חzz 3&2 gNWɹ}`A@걙@L[yind.,,[/3| L q3@ 2 \.,h]20߁ d(Xf8'+7`8s"氠ab @|R (RA_'#3+A r5Bd(H'd | ;"RH=HH?\b  '޾cr##iԃ́+@1A" g=ci"ԃ́@&e"0{a?(0IJ[dP|E ``w);o? bB T/@a)Þ wgؿ8-000|2 ?b+ÛߟٙxxyXEO 2ܴ޲ wf5 @ wIKCb@ ̫ \ *& Br | xǣ ngxw6ÍE7 @1Ta@2\#6h` P ;$_{EoP='h Mh? OP6ȼf$p@Ř>57w  j1',H.}= R}C [wP egA  _RG9 Iy+ G/P FVq@Ù0gA ?Hb(@h &r`Zf ĈÈ2!zjJ$C  \%#eH?SxF?IENDB`ball3 uXdist294uYdist0uStartX31uTime 1057441268420 uTargetX325uStartY160 uTargetY160PNG  IHDRAgAMAOX2tEXtSoftwareAdobe ImageReadyqe<LIDATxba3D\Đ.$/w~z3חzz 3&2 gNWɹ}`A@걙@L[yind.,,[/3| L q3@ 2 \.,h]20߁ d(Xf8'+7`8s"氠ab @|R (RA_'#3+A r5Bd(H'd | ;"RH=HH?\b  '޾cr##iԃ́+@1A" g=ci"ԃ́@&e"0{a?(0IJ[dP|E ``w);o? bB T/@a)Þ wgؿ8-000|2 ?b+ÛߟٙxxyXEO 2ܴ޲ wf5 @ wIKCb@ ̫ \ *& Br | xǣ ngxw6ÍE7 @1Ta@2\#6h` P ;$_{EoP='h Mh? OP6ȼf$p@Ř>57w  j1',H.}= R}C [wP egA  _RG9 Iy+ G/P FVq@Ù0gA ?Hb(@h &r`Zf ĈÈ2!zjJ$C  \%#eH?SxF?IENDB`ball5 uXdist294uYdist0uStartX31uTime 1057441268854 uTargetX325uStartY240 uTargetY240PNG  IHDRAgAMAOX2tEXtSoftwareAdobe ImageReadyqe<LIDATxba3D\Đ.$/w~z3חzz 3&2 gNWɹ}`A@걙@L[yind.,,[/3| L q3@ 2 \.,h]20߁ d(Xf8'+7`8s"氠ab @|R (RA_'#3+A r5Bd(H'd | ;"RH=HH?\b  '޾cr##iԃ́+@1A" g=ci"ԃ́@&e"0{a?(0IJ[dP|E ``w);o? bB T/@a)Þ wgؿ8-000|2 ?b+ÛߟٙxxyXEO 2ܴ޲ wf5 @ wIKCb@ ̫ \ *& Br | xǣ ngxw6ÍE7 @1Ta@2\#6h` P ;$_{EoP='h Mh? OP6ȼf$p@Ř>57w  j1',H.}= R}C [wP egA  _RG9 Iy+ G/P FVq@Ù0gA ?Hb(@h &r`Zf ĈÈ2!zjJ$C  \%#eH?SxF?IENDB`ball7 2uXdist294uYdist0uStartX31uTime 1057441269261 uTargetX325uStartY320 uTargetY320PNG  IHDRAgAMAOX2tEXtSoftwareAdobe ImageReadyqe<LIDATxba3D\Đ.$/w~z3חzz 3&2 gNWɹ}`A@걙@L[yind.,,[/3| L q3@ 2 \.,h]20߁ d(Xf8'+7`8s"氠ab @|R (RA_'#3+A r5Bd(H'd | ;"RH=HH?\b  '޾cr##iԃ́+@1A" g=ci"ԃ́@&e"0{a?(0IJ[dP|E ``w);o? bB T/@a)Þ wgؿ8-000|2 ?b+ÛߟٙxxyXEO 2ܴ޲ wf5 @ wIKCb@ ̫ \ *& Br | xǣ ngxw6ÍE7 @1Ta@2\#6h` P ;$_{EoP='h Mh? OP6ȼf$p@Ř>57w  j1',H.}= R}C [wP egA  _RG9 Iy+ G/P FVq@Ù0gA ?Hb(@h &r`Zf ĈÈ2!zjJ$C  \%#eH?SxF?IENDB`"ball8 _ZuXdist-293uYdist0uStartX618uTime 1057441269464 uTargetX325uStartY360 uTargetY360PNG  IHDRAgAMAOX2tEXtSoftwareAdobe ImageReadyqe<LIDATxba3D\Đ.$/w~z3חzz 3&2 gNWɹ}`A@걙@L[yind.,,[/3| L q3@ 2 \.,h]20߁ d(Xf8'+7`8s"氠ab @|R (RA_'#3+A r5Bd(H'd | ;"RH=HH?\b  '޾cr##iԃ́+@1A" g=ci"ԃ́@&e"0{a?(0IJ[dP|E ``w);o? bB T/@a)Þ wgؿ8-000|2 ?b+ÛߟٙxxyXEO 2ܴ޲ wf5 @ wIKCb@ ̫ \ *& Br | xǣ ngxw6ÍE7 @1Ta@2\#6h` P ;$_{EoP='h Mh? OP6ȼf$p@Ř>57w  j1',H.}= R}C [wP egA  _RG9 Iy+ G/P FVq@Ù0gA ?Hb(@h &r`Zf ĈÈ2!zjJ$C  \%#eH?SxF?IENDB`K_ 55(KP QQ_easeinep2on mouseUp editScript? send "mouseUp" to btn _reset easeIt end mouseUp on easeIt # RUN THE EASEOBJECT SCRIPT FOR EACH "BALL" (TOTAL OF 8) put the uBallNumber of this stack into N if N > 8 then exit easeIt # ESTABLISH OBJECT TO BE ANIMATED put "img ball" & N into tObj # ESTABLISH EASE METHOD ("IN" OR "OUT") put "in" into tMethod # ESTABLISH DESTINATION LOCATION put loc of this cd into tDestLoc put item 2 of loc of img ("ball" & N) into item 2 of tDestLoc if the hilite of btn _centralize then put item 2 of loc of grc _centerloc into item 2 of tDestLoc # INITIALIZE POSITION & TIME PROPERTIES FOR EACH BALL (SEE CARD SCRIPT FOR HANDLER) initObj tObj,tDestLoc # ESTABLISH TIMING FOR EASE ACTION (ADD OPTIONAL RANDOMIZATION) put 1 into R if the hilite of btn _randomize then get random(5) if it = 1 then put 0.5 into R if it = 2 then put 0.75 into R if it = 3 then put 1 into R if it = 4 then put 1.5 into R if it = 5 then put 2 into R end if put (fld _duration * R) into tTiming # START OBJECT ANIMATION easeObject tObj,tMethod,tTiming # RUN THIS HANDLER AGAIN FOR THE NEXT "BALL" OBJECT set the uBallNumber of this stack to (the uBallNumber of this stack + 1) send "easeIt" to me in (fld _delay) milliseconds end easeIt nEase-In $ _centerlocC3%%h label3 WhiteT  Methods  &label4 WhitesT  Options  ' _randomize@eon mouseUp end mouseUp @JRandomize Duration _resetep$on mouseUp editScript? repeat for each line L in the pendingMessages cancel item 1 of L end repeat repeat for each line L in the movingControls do "stop moving" && L end repeat repeat with B = 1 to 8 if the hilite of btn _fade then set blendLevel of img ("ball" & B) to 100 if "." is in (B/2) then set left of img ("ball" & B) to 20 else set right of img ("ball" & B) to width of this stack - 20 set top of img ("ball" & B) to ((B*40)+26) end repeat set the uBallNumber of this stack to 1 end mouseUp  Reset ball2 _juXdist-293uYdist0uStartX618uTime 1057441268202 uTargetX325uStartY120 uTargetY120PNG  IHDRAgAMAOX2tEXtSoftwareAdobe ImageReadyqe<LIDATxba3D\Đ.$/w~z3חzz 3&2 gNWɹ}`A@걙@L[yind.,,[/3| L q3@ 2 \.,h]20߁ d(Xf8'+7`8s"氠ab @|R (RA_'#3+A r5Bd(H'd | ;"RH=HH?\b  '޾cr##iԃ́+@1A" g=ci"ԃ́@&e"0{a?(0IJ[dP|E ``w);o? bB T/@a)Þ wgؿ8-000|2 ?b+ÛߟٙxxyXEO 2ܴ޲ wf5 @ wIKCb@ ̫ \ *& Br | xǣ ngxw6ÍE7 @1Ta@2\#6h` P ;$_{EoP='h Mh? OP6ȼf$p@Ř>57w  j1',H.}= R}C [wP egA  _RG9 Iy+ G/P FVq@Ù0gA ?Hb(@h &r`Zf ĈÈ2!zjJ$C  \%#eH?SxF?IENDB` ball4 _uXdist-293uYdist0uStartX618uTime 1057441268651 uTargetX325uStartY200 uTargetY200PNG  IHDRAgAMAOX2tEXtSoftwareAdobe ImageReadyqe<LIDATxba3D\Đ.$/w~z3חzz 3&2 gNWɹ}`A@걙@L[yind.,,[/3| L q3@ 2 \.,h]20߁ d(Xf8'+7`8s"氠ab @|R (RA_'#3+A r5Bd(H'd | ;"RH=HH?\b  '޾cr##iԃ́+@1A" g=ci"ԃ́@&e"0{a?(0IJ[dP|E ``w);o? bB T/@a)Þ wgؿ8-000|2 ?b+ÛߟٙxxyXEO 2ܴ޲ wf5 @ wIKCb@ ̫ \ *& Br | xǣ ngxw6ÍE7 @1Ta@2\#6h` P ;$_{EoP='h Mh? OP6ȼf$p@Ř>57w  j1',H.}= R}C [wP egA  _RG9 Iy+ G/P FVq@Ù0gA ?Hb(@h &r`Zf ĈÈ2!zjJ$C  \%#eH?SxF?IENDB`!ball6 _ uXdist-293uYdist0uStartX618uTime 1057441269058 uTargetX325uStartY280 uTargetY280PNG  IHDRAgAMAOX2tEXtSoftwareAdobe ImageReadyqe<LIDATxba3D\Đ.$/w~z3חzz 3&2 gNWɹ}`A@걙@L[yind.,,[/3| L q3@ 2 \.,h]20߁ d(Xf8'+7`8s"氠ab @|R (RA_'#3+A r5Bd(H'd | ;"RH=HH?\b  '޾cr##iԃ́+@1A" g=ci"ԃ́@&e"0{a?(0IJ[dP|E ``w);o? bB T/@a)Þ wgؿ8-000|2 ?b+ÛߟٙxxyXEO 2ܴ޲ wf5 @ wIKCb@ ̫ \ *& Br | xǣ ngxw6ÍE7 @1Ta@2\#6h` P ;$_{EoP='h Mh? OP6ȼf$p@Ř>57w  j1',H.}= R}C [wP egA  _RG9 Iy+ G/P FVq@Ù0gA ?Hb(@h &r`Zf ĈÈ2!zjJ$C  \%#eH?SxF?IENDB`% _centralize@eLon mouseUp set the vis of grc _centerloc to the hilite of me end mouseUp @JyCentral Target )label2 White  Delay Next (ms):  *_delay+`>  200  + _easeoutep3on mouseUp editScript? send "mouseUp" to btn _reset easeIt end mouseUp on easeIt # RUN THE EASEOBJECT SCRIPT FOR EACH "BALL" (TOTAL OF 8) put the uBallNumber of this stack into N if N > 8 then exit easeIt # ESTABLISH OBJECT TO BE ANIMATED put "img ball" & N into tObj # ESTABLISH EASE METHOD ("IN" OR "OUT") put "out" into tMethod # ESTABLISH DESTINATION LOCATION put loc of this cd into tDestLoc put item 2 of loc of img ("ball" & N) into item 2 of tDestLoc if the hilite of btn _centralize then put item 2 of loc of grc _centerloc into item 2 of tDestLoc # INITIALIZE POSITION & TIME PROPERTIES FOR EACH BALL (SEE CARD SCRIPT FOR HANDLER) initObj tObj,tDestLoc # ESTABLISH TIMING FOR EASE ACTION (ADD OPTIONAL RANDOMIZATION) put 1 into R if the hilite of btn _randomize then get random(5) if it = 1 then put 0.5 into R if it = 2 then put 0.75 into R if it = 3 then put 1 into R if it = 4 then put 1.5 into R if it = 5 then put 2 into R end if put (fld _duration * R) into tTiming # START OBJECT ANIMATION easeObject tObj,tMethod,tTiming # RUN THIS HANDLER AGAIN FOR THE NEXT "BALL" OBJECT set the uBallNumber of this stack to (the uBallNumber of this stack + 1) send "easeIt" to me in (fld _delay) milliseconds end easeIt n Ease-Out _moveepon mouseUp editScript? send "mouseUp" to btn _reset moveEm end mouseUp on moveEm put the uBallNumber of this stack into N if N > 8 then exit moveEm put loc of this cd into tLoc put item 2 of loc of img ("ball" & N) into item 2 of tLoc if the hilite of btn _centralize then put item 2 of loc of grc _centerloc into item 2 of tLoc set the uTime of img ("ball" & N) to the milliseconds put 1 into R if the hilite of btn _randomize then get random(5) if it = 1 then put 0.5 into R if it = 2 then put 0.75 into R if it = 3 then put 1 into R if it = 4 then put 1.5 into R if it = 5 then put 2 into R end if move img ("ball" & N) to tLoc in (fld _duration * R) milliseconds without waiting if the hilite of btn _fade then fadeTimer ("ball" & N) set the uBallNumber of this stack to the uBallNumber of this stack + 1 send "moveEm" to me in (fld _delay) milliseconds end moveEm on fadeTimer tObj if the milliseconds >= (the uTime of img tObj + fld _duration) then exit fadeTimer set the blendLevel of img tObj to 100-trunc(100*((the milliseconds - the uTime of img tObj)/fld _duration)) send "fadeTimer" && quote & tObj & quote to me in 10 milliseconds end fadeTimer nMove