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

  1. /*
  2. ** Roll.fred.pre
  3. **
  4. ** $VER: Roll.fred.pre 1.2.1 (17.1.94)
  5. **
  6. ** If the Roll.fred script appears in the InvokeADPro list, this program will
  7. ** ask the user to enter the number of pixels to roll, in what direction, and
  8. ** whether to wrap the image or not.
  9. **
  10. ** Clips Exported:
  11. **    FREDRollPixels        -    Number of pixels to roll
  12. **    FREDRollDirection    -    Direction to roll pixels
  13. **    FREDRollWrap        -    How to wrap the image
  14. **
  15. ** NOTE: Clip names are case sensitive.
  16. **
  17. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  18. ** ADPro v2.5.0 (or higher).
  19. **
  20. ** Copyright © 1993-1994 ASDG, Incorporated
  21. ** All Rights Reserved
  22. */
  23.  
  24.  
  25. ADDRESS "ADPro"
  26. OPTIONS RESULTS
  27.  
  28. PARSE ARG NumberOfCells NumberOfFrames
  29.  
  30. NL = '0A'X
  31. SQ = '27'X
  32. DQ = '22'X
  33. TRUE  = 1
  34. FALSE = 0
  35.  
  36.  
  37. /*
  38. ** Ask the user for a pixel aspect to scale to.
  39. */
  40.  
  41. DirectionID.1 = "DOWN"
  42. DirectionID.2 = "LEFT"
  43. DirectionID.3 = "UP"
  44. DirectionID.4 = "RIGHT"
  45. DirectionID.5 = "UPLEFT"
  46. DirectionID.6 = "UPRIGHT"
  47. DirectionID.7 = "DOWNRIGHT"
  48. DirectionID.8 = "DOWNLEFT"
  49. MinDirectionID = 1
  50. MaxDirectionID = 8
  51. DefDirectionID = 1
  52.  
  53. String = '"' || DirectionID.DefDirectionID || '"'
  54. DO LoopCounter = MinDirectionID TO MaxDirectionID
  55.     String = String '"' || DirectionID.LoopCounter || '"'
  56. END
  57.  
  58. continue = 0
  59. DO UNTIL (continue = 1)
  60.     ADPRO_TO_FRONT
  61.  
  62.     LISTVIEW '"Roll Direction:"' (MaxDirectionID-MinDirectionID+1) ITEMS String
  63.     LISTVIEW_RC = RC
  64.     PARSE VAR ADPRO_RESULT '"'DirectionStr'"' scratch
  65.  
  66.     IF (LISTVIEW_RC ~= 0) & (LISTVIEW_RC ~= 1) THEN DO
  67.         ADPRO_TO_FRONT
  68.  
  69.         OKAYN '"Roll.fred"' '"This value is required."' '"Retry|Cancel"'
  70.         IF (RC = 0) THEN
  71.             EXIT 10
  72.     END
  73.     ELSE
  74.         continue = 1
  75. END
  76.  
  77. DirectionSelected = MinDirectionID
  78. DO WHILE (DirectionSelected <= MaxDirectionID) & (COMPARE( DirectionStr, DirectionID.DirectionSelected ) ~= 0)
  79.     DirectionSelected = DirectionSelected + 1
  80. END
  81.  
  82. RollDirection = DirectionID.DirectionSelected
  83.  
  84. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Enter pixels to roll"' 1 1 240 TRUE
  85. IF (RESULT = (1-1)) THEN
  86.     EXIT 10
  87. RollPixels = RESULT
  88.  
  89. ADPRO_TO_FRONT
  90.  
  91. OKAYN '"Roll.fred"' '"Wrap image?"' '"Wrap Around|No Wrapping|Cancel"'
  92. IF (RC = 0) THEN DO
  93.     SCREEN_TO_FRONT "FRED"
  94.     EXIT 10
  95. END
  96. ELSE IF (RC = 1) THEN
  97.     RollWrap = "WRAP"
  98. ELSE IF (RC = 2) THEN
  99.     RollWrap = "NO_WRAP"
  100.  
  101.  
  102. /*
  103. ** Update the clips.
  104. */
  105.  
  106. SETCLIP( "FREDRollPixels", RollPixels )
  107. SETCLIP( "FREDRollDirection", RollDirection )
  108. SETCLIP( "FREDRollWrap", RollWrap )
  109.  
  110. EXIT 0
  111.