home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / ADPro251-3.DMS / ADPro251-3.adf / FREDScripts.lha / FREDOperators / GradualMosaic.fred.pre < prev    next >
Encoding:
Text File  |  1994-01-31  |  3.6 KB  |  130 lines

  1. /*
  2. ** GradualMosaic.fred.pre
  3. **
  4. ** $VER: GradualMosaic.fred.pre 1.1.0 (23.10.93)
  5. **
  6. ** If the GradualMosaic.fred script appears in the InvokeADPro list,
  7. ** this program will ask the user to enter the starting and ending values
  8. ** for the mosaic.
  9. **
  10. ** Clips Exported:
  11. **    FREDGradualMosaicXOffCurr    -    Current X Offset
  12. **    FREDGradualMosaicYOffCurr    -    Current Y Offset
  13. **    FREDGradualMosaicWidthCurr    -    Current Tile Width
  14. **    FREDGradualMosaicHeightCurr    -    Current Tile Height
  15. **    FREDGradualMosaicXOffIncr    -    X Offset increment per frame
  16. **    FREDGradualMosaicYOffIncr    -    Y Offset increment per frame
  17. **    FREDGradualMosaicWidthIncr    -    Tile Width increment per frame
  18. **    FREDGradualMosaicHeightIncr    -    Tile Height increment per frame
  19. **    FREDGradualMosaicXOffFinal    -    Final X Offset
  20. **    FREDGradualMosaicYOffFinal    -    Final Y Offset
  21. **    FREDGradualMosaicWidthFinal    -    Final Tile Width
  22. **    FREDGradualMosaicHeightFinal    -    Final Tile Height
  23. **    FREDGradualMosaicNumberOfFrames    -    The number of frames selected
  24. **    FREDGradualMosaicFrameCount    -    The number of frames already processed
  25. **
  26. ** NOTE: Clip names are case sensitive.
  27. **
  28. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  29. ** ADPro v2.5.0 (or higher).
  30. **
  31. ** Copyright © 1993 ASDG, Incorporated
  32. ** All Rights Reserved
  33. */
  34.  
  35.  
  36. ADDRESS "ADPro"
  37. OPTIONS RESULTS
  38.  
  39. PARSE ARG NumberOfCells NumberOfFrames
  40.  
  41. NL = '0A'X
  42. SQ = '27'X
  43. DQ = '22'X
  44. TRUE  = 1
  45. FALSE = 0
  46.  
  47.  
  48. /*
  49. ** Ensure that at least two frames are to be processed.
  50. */
  51.  
  52. IF (NumberOfFrames < 2) THEN DO
  53.     ADPRO_TO_FRONT
  54.     OKAY1 "Frame count must be more than 2."
  55.     SCREEN_TO_FRONT "FRED"
  56.     EXIT 10
  57. END
  58.  
  59.  
  60. /*
  61. ** Ask the user for the initial parameters.
  62. */
  63.  
  64. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting X Offset"' 0 0 32767 TRUE
  65. IF (RESULT = (0-1)) THEN
  66.     EXIT 10
  67. CurrXOff = RESULT
  68.  
  69. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting Y Offset"' 0 0 32767 TRUE
  70. IF (RESULT = (0-1)) THEN
  71.     EXIT 10
  72. CurrYOff = RESULT
  73.  
  74. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting Tile Width"' 20 1 32767 TRUE
  75. IF (RESULT = (1-1)) THEN
  76.     EXIT 10
  77. CurrWidth = RESULT
  78.  
  79. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting Tile Height"' 20 1 32767 TRUE
  80. IF (RESULT = (1-1)) THEN
  81.     EXIT 10
  82. CurrHeight = RESULT
  83.  
  84.  
  85. /*
  86. ** Ask the user for the final parameters.
  87. */
  88.  
  89. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending X Offset"' 0 0 32767 TRUE
  90. IF (RESULT = (0-1)) THEN
  91.     EXIT 10
  92. FinalXOff = RESULT
  93.  
  94. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending Y Offset"' 0 0 32767 TRUE
  95. IF (RESULT = (0-1)) THEN
  96.     EXIT 10
  97. FinalYOff = RESULT
  98.  
  99. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending Tile Width"' 20 1 32767 TRUE
  100. IF (RESULT = (1-1)) THEN
  101.     EXIT 10
  102. FinalWidth = RESULT
  103.  
  104. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending Tile Height"' 20 1 32767 TRUE
  105. IF (RESULT = (1-1)) THEN
  106.     EXIT 10
  107. FinalHeight = RESULT
  108.  
  109.  
  110. /*
  111. ** Update the clips.
  112. */
  113.  
  114. SETCLIP( "FREDGradualMosaicXOffCurr", CurrXOff )
  115. SETCLIP( "FREDGradualMosaicYOffCurr", CurrYOff )
  116. SETCLIP( "FREDGradualMosaicWidthCurr", CurrWidth )
  117. SETCLIP( "FREDGradualMosaicHeightCurr", CurrHeight )
  118. SETCLIP( "FREDGradualMosaicXOffIncr", (FinalXOff - CurrXOff) / (NumberOfFrames - 1) )
  119. SETCLIP( "FREDGradualMosaicYOffIncr", (FinalYOff - CurrYOff) / (NumberOfFrames - 1) )
  120. SETCLIP( "FREDGradualMosaicWidthIncr", (FinalWidth - CurrWidth) / (NumberOfFrames - 1) )
  121. SETCLIP( "FREDGradualMosaicHeightIncr", (FinalHeight - CurrHeight) / (NumberOfFrames - 1) )
  122. SETCLIP( "FREDGradualMosaicXOffFinal", FinalXOff )
  123. SETCLIP( "FREDGradualMosaicYOffFinal", FinalYOff )
  124. SETCLIP( "FREDGradualMosaicWidthFinal", FinalWidth )
  125. SETCLIP( "FREDGradualMosaicHeightFinal", FinalHeight )
  126. SETCLIP( "FREDGradualMosaicNumberOfFrames", NumberOfFrames )
  127. SETCLIP( "FREDGradualMosaicFrameCount", 0 )
  128.  
  129. EXIT 0
  130.