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

  1. /*
  2. ** GradualScale.fred.pre
  3. **
  4. ** $VER: GradualScale.fred.pre 1.1.0 (23.10.93)
  5. **
  6. ** If the GradualScale.fred script appears in the InvokeADPro list,
  7. ** this program will ask the user to enter the beginning and ending width and height.
  8. **
  9. ** Clips Exported:
  10. **    FREDGradualWidthCurr    -    Current width
  11. **    FREDGradualHeightCurr    -    Current height
  12. **    FREDGradualWidthIncr    -    Width increment per frame
  13. **    FREDGradualHeightIncr    -    Height increment per frame
  14. **    FREDGradualWidthFinal    -    Final width
  15. **    FREDGradualHeightFinal    -    Final height
  16. **    FREDNumberOfFrames    -    The number of frames selected
  17. **    FREDFrameCount        -    The number of frames already processed
  18. **
  19. ** NOTE: Clip names are case sensitive.
  20. **
  21. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  22. ** ADPro v2.5.0 (or higher).
  23. **
  24. ** Copyright © 1992-1993 ASDG, Incorporated
  25. ** All Rights Reserved
  26. */
  27.  
  28.  
  29. ADDRESS "ADPro"
  30. OPTIONS RESULTS
  31.  
  32. PARSE ARG NumberOfCells NumberOfFrames
  33.  
  34. NL = '0A'X
  35. SQ = '27'X
  36. DQ = '22'X
  37. TRUE  = 1
  38. FALSE = 0
  39.  
  40.  
  41. /*
  42. ** Ensure that at least two frames are to be processed.
  43. */
  44.  
  45. IF (NumberOfFrames < 2) THEN DO
  46.     ADPRO_TO_FRONT
  47.     OKAY1 "Frame count must be more than 2."
  48.     SCREEN_TO_FRONT "FRED"
  49.     EXIT 10
  50. END
  51.  
  52.  
  53. /*
  54. ** Set some default values.
  55. */
  56.  
  57. StartingWidth  = 640
  58. StartingHeight = 400
  59. EndingWidth  = 320
  60. EndingHeight = 200
  61.  
  62.  
  63. /*
  64. ** See what type of data is loaded in ADPro/MorphPlus.
  65. */
  66.  
  67. CALL "FREDSCRIPTS:FREDFunctions/CheckForImageData"
  68. IF (RESULT = 0) THEN DO
  69.     XSIZE
  70.     StartingWidth = ADPRO_RESULT
  71.  
  72.     YSIZE
  73.     StartingHeight = ADPRO_RESULT
  74. END
  75.  
  76.  
  77. /*
  78. ** Ask the user for a starting size using the currently loaded width as default.
  79. */
  80.  
  81. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting width"' StartingWidth 1 999999 TRUE
  82. StartingWidth = RESULT
  83. IF (StartingWidth = (1-1)) THEN
  84.     EXIT 10
  85.  
  86.  
  87. /*
  88. ** Ask the user for a starting size using the currently loaded height as default.
  89. */
  90.  
  91. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Starting height"' StartingHeight 1 999999 TRUE
  92. StartingHeight = RESULT
  93. IF (StartingHeight = (1-1)) THEN
  94.     EXIT 10
  95.  
  96.  
  97. /*
  98. ** Ask the user for an ending size using the currently loaded width as default.
  99. */
  100.  
  101. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending width"' EndingWidth 1 999999 TRUE
  102. EndingWidth = RESULT
  103. IF (EndingWidth = (1-1)) THEN
  104.     EXIT 10
  105.  
  106.  
  107. /*
  108. ** Ask the user for an ending size using the currently loaded height as default.
  109. */
  110.  
  111. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Ending height"' EndingHeight 1 999999 TRUE
  112. EndingHeight = RESULT
  113. IF (EndingHeight = (1-1)) THEN
  114.     EXIT 10
  115.  
  116.  
  117. /*
  118. ** Update the clips.
  119. */
  120.  
  121. SETCLIP( "FREDGradualWidthCurr", StartingWidth )
  122. SETCLIP( "FREDGradualHeightCurr", StartingHeight )
  123. SETCLIP( "FREDGradualWidthIncr", (EndingWidth - StartingWidth) / (NumberOfFrames - 1) )
  124. SETCLIP( "FREDGradualHeightIncr", (EndingHeight - StartingHeight) / (NumberOfFrames - 1) )
  125. SETCLIP( "FREDGradualWidthFinal", EndingWidth )
  126. SETCLIP( "FREDGradualHeightFinal", EndingHeight )
  127. SETCLIP( "FREDNumberOfFrames", NumberOfFrames )
  128. SETCLIP( "FREDFrameCount", 0 )
  129.  
  130. EXIT 0
  131.