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

  1. /*
  2. ** HorizontalScroll.fred.pre
  3. **
  4. ** $VER: HorizontalScroll.fred.pre 1.2.0 (23.10.93)
  5. **
  6. ** If the HorizontalScroll.fred scripts appears in the InvokeADPro list,
  7. ** this program will set up some variables.
  8. **
  9. ** Clips Exported:
  10. **    FREDNumberOfFrames    -    Total frames selected
  11. **    FREDXPosition        -    Current X Position of the frame
  12. **    FREDXIncrement        -    X Increment per frame
  13. **    FREDXDirection        -    ~0 if movement is to the right
  14. **                    0 if to the left
  15. **    FREDRollWrap        -    ~0 if image should wrap around
  16. **                    0 if not
  17. **    FREDOverrideLength    -    Set this to 1
  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. ** Ask the user in which direction (left or right) the image should scroll.
  55. */
  56.  
  57. ADPRO_TO_FRONT
  58.  
  59. OKAYN '"HorizontalScroll.fred"' '"Choose scroll direction."' '"Left-Right|Right-Left|Cancel"'
  60. IF (RC = 0) THEN DO
  61.     SCREEN_TO_FRONT "FRED"
  62.     EXIT 10
  63. END
  64. ELSE
  65.     XDirection = 2 - RC
  66.  
  67.  
  68. /*
  69. ** Ask the user if the scrolled image should wrap around.
  70. */
  71.  
  72. ADPRO_TO_FRONT
  73.  
  74. OKAYN '"HorizontalScroll.fred"' '"Wrap image?"' '"Wrap|No Wrap|Cancel"'
  75. IF (RC = 0) THEN DO
  76.     SCREEN_TO_FRONT "FRED"
  77.     EXIT 10
  78. END
  79. ELSE
  80.     RollWrap = 2 - RC
  81.  
  82. SCREEN_TO_FRONT "FRED"
  83.  
  84.  
  85. /*
  86. ** Update the clips.
  87. */
  88.  
  89. SETCLIP( "FREDNumberOfFrames", NumberOfFrames )
  90. SETCLIP( "FREDXPosition", 0 )
  91. SETCLIP( "FREDXIncrement", 0 )
  92. SETCLIP( "FREDXDirection", XDirection )
  93. SETCLIP( "FREDOverrideLength", 1 )
  94. SETCLIP( "FREDRollWrap", RollWrap )
  95.  
  96. EXIT 0
  97.