home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 61 / af061a.adf / Macros / DynAnim.clssa < prev    next >
Text File  |  1993-05-03  |  3KB  |  87 lines

  1. /***********************************************************************
  2.  GADGET: "DynAnimRecord" "2" AUTO TYP: "?"
  3.  
  4.  $DAT >>DynAnim.clssa<< 03 May 1993 - (C) ProDAD Holger Burkarth
  5.  
  6.  The current anim is adjusted in size and then joined to the Master
  7.  anim. The first frame is taken from the current range.  The macro asks
  8.  for the desired frame number and uses this value to to represent the
  9.  new range length. The program tries to evenly distribute the frames.
  10. ************************************************************************/
  11. Options RESULTS
  12. Address clariSSA
  13.  
  14.   FailAt 10
  15.   AltFail=RESULT
  16.  
  17.   DO FOREVER
  18.     SelectAnim "Source_A Source_B Source_C Source_D",
  19.                "TITLE 'Select the Source Anim@for the dynamic recording.'",
  20.                "REQ"
  21.     IF rc > 1 THEN LEAVE
  22.     WorkAnim=RESULT
  23.  
  24.     IF WorkAnim~="Master" THEN DO
  25.       GetAnimInfo WorkAnim
  26.       IF RESULT='' THEN WorkAnim=""
  27.  
  28.       IF WorkAnim~='' THEN DO
  29.         SelectAnim WorkAnim
  30.         GetArea
  31.         MerkeArea=RESULT
  32.         PARSE VAR MerkeArea "FROM" von "TO" bis Richtung
  33.  
  34.         IF Richtung="UP" THEN Richtung= 1
  35.         ELSE                  Richtung=-1
  36.  
  37.         NaturAnzahl=bis - von +1
  38.         IF NaturAnzahl > 3 THEN DO
  39.           INTRequest "'Selected Range == "NaturAnzahl" Frames''Please enter the desired''frame number'" NaturAnzahl
  40.           IF RC~=0 THEN LEAVE
  41.           SynAnzahl=RESULT
  42.           IF SynAnzahl > 1 THEN DO
  43.  
  44.             IF Richtung=-1 THEN DO
  45.               M=von
  46.               von=bis
  47.               bis=M
  48.             END
  49.  
  50.             M=0
  51.             S=(SynAnzahl-1)/NaturAnzahl
  52.             C=1
  53.             PARSE VAR Datei pos Datei
  54.             DO UNTIL NaturAnzahl<1
  55.               C=C+S
  56.  
  57.               x=TRUNC(C)
  58.               IF M~=x THEN DO
  59.                 rep=x-M
  60.                 M=x
  61.                 SetArea FROM von TO von
  62.                 l=0
  63.                 DO UNTIL l>=rep
  64.                   l=l+1
  65.                   Record "AREA"
  66.                   IF rc~=0 THEN LEAVE
  67.                 END
  68.                 IF rc~=0 THEN LEAVE
  69.               END
  70.               NaturAnzahl=NaturAnzahl-1
  71.               von=von+Richtung
  72.             END
  73.  
  74.             SetArea MerkeArea
  75.             SelectAnim MASTER
  76.  
  77.           END; ELSE Message "'Wrong Input!'"
  78.         END; ELSE Message "'For a dynamic recording you need''to use at least 4 Frames.'"
  79.       END; ELSE Message '"No Anim Available!"'
  80.     END; ELSE Message "'MASTER-Anim is for recording!''First you must select''a Source-Anim.'"
  81.  
  82.     LEAVE
  83.   END
  84.   FailAt AltFail
  85.  
  86. exit
  87.